API Endpoint for authentification using the user's email ans password
POST
/auth/login
curl \
-X POST http://localhost:3003/api/dev/auth/login \
-H "Authorization: Noauth $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"email":"mohamedhassen.jahha@assistdigital.com","password":"p8\u0026Q4f7B","code":"963228"}'
Request example
{
"email": "mohamedhassen.jahha@assistdigital.com",
"password": "p8&Q4f7B",
"code": "963228"
}
Request examples
{
"code": "963228",
"email": "mohamedhassen.jahha@assistdigital.com",
"password": "p8&Q4f7B"
}
Response examples (200)
# Headers
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Resource-Policy: same-origin
Origin-Agent-Cluster: ?1
Referrer-Policy: no-referrer
Strict-Transport-Security: max-age=15552000; includeSubDomains
X-Content-Type-Options: nosniff
X-DNS-Prefetch-Control: off
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Retry-After: 599.696
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 99
X-RateLimit-Reset: Mon Oct 30 2023 02:46:38 GMT+0100 (Central European Standard Time)
x-powered-by: TUNISIAN RED CRESSCENT
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1N2RkNTYxMC01ODk2LTRjZjMtOWY1OC0yZTdlNzdmZWI4ODgiLCJpYXQiOjE2OTg2Mjk4MDEsImV4cCI6MTY5ODY1MTQwMX0.N-SCsoroDjdilEdsGlHlWjW9b_1vZD7Q3qfstBNSYew
Content-Type: application/json; charset=utf-8
Content-Length: 2776
ETag: W/"ad8-mFStY8u01EGAJAz9fcbaNBZTsGo"
Date: Mon, 30 Oct 2023 01:36:41 GMT
Connection: keep-alive
Keep-Alive: timeout=5
# Payload
{
"code": 200,
"user": {
"userID": "57dd5610-5896-4cf3-9f58-2e7e77feb888",
"name": "Mohamed Hassen",
"lastName": "JAHHA",
"email": "mohamedhassen.jahha@assistdigital.com",
"DoC": "2023-04-17T07:46:10.000Z",
"avatar": "/media/2bc45102-9487-4e87-8dd6-87f03e34752c.png",
"phoneCode": "216",
"phone": "58076667",
"isActive": true,
"isVerified": true,
"profile": "AL",
"role": null,
"lastActive": "2023-10-29T13:43:17.336Z",
"isOtpEnabled": false,
"isOtpVerified": true,
"committeeID": "af7c1fe6-d669-414e-b066-e9733f0de7a8",
"Committee": {
"committeeID": "af7c1fe6-d669-414e-b066-e9733f0de7a8",
"nameArabe": "الهيئة المركزية",
"type": "NAT",
"nameLatin": "Comité central",
"dateOfEst": "1956-11-07T00:00:00.000Z",
"VAT": "33049Y/N/P/N/000",
"address": "19, Rue d'Angleterre",
"region": "Tunis",
"city": "Tunis",
"postalCode": 1000,
"isActive": true,
"primaryEmail": "contact@croissant-rouge.tn",
"secondaryEmail": null,
"primaryPhone": "+21671325572",
"secondaryPhone": "+21671320630"
},
"LoginActivity": [
{
"loginActivityID": 1,
"userID": "57dd5610-5896-4cf3-9f58-2e7e77feb888",
"ip": ":1",
"continent": null,
"countryCode": null,
"browser": "Other",
"os": "Other",
"device": "Other",
"lat": null,
"lon": null,
"country": null,
"city": null,
"region": null,
"isp": null,
"createdAt": "2023-10-04T05:03:20.399Z"
},
{
"loginActivityID": 2,
"userID": "57dd5610-5896-4cf3-9f58-2e7e77feb888",
"ip": ":1",
"continent": null,
"countryCode": null,
"browser": "Other",
"os": "Other",
"device": "Other",
"lat": null,
"lon": null,
"country": null,
"city": null,
"region": null,
"isp": null,
"createdAt": "2023-10-04T05:05:23.254Z"
},
{
"loginActivityID": 3,
"userID": "57dd5610-5896-4cf3-9f58-2e7e77feb888",
"ip": ":1",
"continent": null,
"countryCode": null,
"browser": "Other",
"os": "Other",
"device": "Other",
"lat": null,
"lon": null,
"country": null,
"city": null,
"region": null,
"isp": null,
"createdAt": "2023-10-04T05:11:10.348Z"
},
{
"loginActivityID": 4,
"userID": "57dd5610-5896-4cf3-9f58-2e7e77feb888",
"ip": ":1",
"continent": null,
"countryCode": null,
"browser": "Other",
"os": "Other",
"device": "Other",
"lat": null,
"lon": null,
"country": null,
"city": null,
"region": null,
"isp": null,
"createdAt": "2023-10-04T05:11:13.609Z"
},
{
"loginActivityID": 5,
"userID": "57dd5610-5896-4cf3-9f58-2e7e77feb888",
"ip": ":1",
"continent": null,
"countryCode": null,
"browser": "Other",
"os": "Other",
"device": "Other",
"lat": null,
"lon": null,
"country": null,
"city": null,
"region": null,
"isp": null,
"createdAt": "2023-10-04T05:12:14.383Z"
}
],
"otpAuthUrl": "otpauth://totp/Mohamed%20Hassen?secret=NNZHIPTDFQUE2JJ2ERLSCZDZONZU2YJX&issuer=SWIFT%20TRC",
"otpBase32": "NNZHIPTDFQUE2JJ2ERLSCZDZONZU2YJX",
"passwordlessBase32": "MNGGOJDIIA7T6I25LVKVGMBMGYRXOVBY",
"permissions": "[]",
"token": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1N2RkNTYxMC01ODk2LTRjZjMtOWY1OC0yZTdlNzdmZWI4ODgiLCJpYXQiOjE2OTg2Mjk4MDEsImV4cCI6MTY5ODY1MTQwMX0.N-SCsoroDjdilEdsGlHlWjW9b_1vZD7Q3qfstBNSYew"
}
}
Response examples (200)
# Headers
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Resource-Policy: same-origin
Origin-Agent-Cluster: ?1
Referrer-Policy: no-referrer
Strict-Transport-Security: max-age=15552000; includeSubDomains
X-Content-Type-Options: nosniff
X-DNS-Prefetch-Control: off
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Retry-After: 599.696
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 99
X-RateLimit-Reset: Mon Oct 30 2023 02:46:38 GMT+0100 (Central European Standard Time)
x-powered-by: TUNISIAN RED CRESSCENT
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1N2RkNTYxMC01ODk2LTRjZjMtOWY1OC0yZTdlNzdmZWI4ODgiLCJpYXQiOjE2OTg2Mjk4MDEsImV4cCI6MTY5ODY1MTQwMX0.N-SCsoroDjdilEdsGlHlWjW9b_1vZD7Q3qfstBNSYew
Content-Type: application/json; charset=utf-8
Content-Length: 2776
ETag: W/"ad8-mFStY8u01EGAJAz9fcbaNBZTsGo"
Date: Mon, 30 Oct 2023 01:36:41 GMT
Connection: keep-alive
Keep-Alive: timeout=5
# Payload
{}
Response examples (401)
# Headers
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Resource-Policy: same-origin
Origin-Agent-Cluster: ?1
Referrer-Policy: no-referrer
Strict-Transport-Security: max-age=15552000; includeSubDomains
X-Content-Type-Options: nosniff
X-DNS-Prefetch-Control: off
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Retry-After: 495.097
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 94
X-RateLimit-Reset: Mon Oct 30 2023 02:46:38 GMT+0100 (Central European Standard Time)
x-powered-by: TUNISIAN RED CRESSCENT
Content-Type: application/json; charset=utf-8
Content-Length: 147
ETag: W/"93-sq1pbdnP3EaMQMYbMt4Hd5KnqQQ"
Date: Mon, 30 Oct 2023 01:38:23 GMT
Connection: keep-alive
Keep-Alive: timeout=5
# Payload
{
"code": 401,
"message": {
"RESPONSE_TEXT": "Oups! Il semblerait que vos identifiants soient incorrect",
"RESPONSE_CODE": "BAD_AUTH_COMBINATION_MESSAGE"
}
}
Response examples (401)
# Headers
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Resource-Policy: same-origin
Origin-Agent-Cluster: ?1
Referrer-Policy: no-referrer
Strict-Transport-Security: max-age=15552000; includeSubDomains
X-Content-Type-Options: nosniff
X-DNS-Prefetch-Control: off
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Retry-After: 495.097
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 94
X-RateLimit-Reset: Mon Oct 30 2023 02:46:38 GMT+0100 (Central European Standard Time)
x-powered-by: TUNISIAN RED CRESSCENT
Content-Type: application/json; charset=utf-8
Content-Length: 147
ETag: W/"93-sq1pbdnP3EaMQMYbMt4Hd5KnqQQ"
Date: Mon, 30 Oct 2023 01:38:23 GMT
Connection: keep-alive
Keep-Alive: timeout=5
# Payload
{}