Login with email and password
POST /sessions
POST
/sessions
Will generate a session token for the user using email and password
Flow:
- Validate request.
- email and password are required.
- device info are coming from headers, and they’re optional. - Validate user with the email should exists
- Validate user status is not blocked or paused
- Validate password should be correct
- Insert to device table
- Generate refresh token and insert to refresh_token table
- Update user’s last_active_at
- Generate JWT access token and return to user.
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”LoginEmailRequest
object
email
string
ivan+rdh+fl@joingotu.com password
string
1234567890 turnstileToken
string
Responses
Section titled “ Responses ”OK
object
data
object
accessToken
string
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhdXRoLXNlcnZpY2UiLCJzdWIiOiI2NWI4YTE2MjYzNTEyNjAwMTI3YTQxYTQiLCJleHAiOjE3MzkyNzYwNzMsIm5iZiI6MTczOTI3NTE3MywiaWF0IjoxNzM5Mjc1MTczLCJqdGkiOiJjdWxqbjlhc3A1anJmam83NWdiZyIsImlkIjoiNjViOGExNjI2MzUxMjYwMDEyN2E0MWE0IiwidXNlclR5cGUiOiJETlQiLCJpc0FkbWluIjp0cnVlLCJkZXZpY2VJZCI6MzE4M30.ZuzROGxJ1pq_veRe93Z8bfS5YTzmAp5_wrzTUmvLzk8 expiresIn
integer
900 refreshToken
string
culjn9asp5jrfjo75gc0 tokenType
string
BearerBad request
object
error
string
some meaningful error messageUnauthorized
object
error
string
some meaningful error messageForbidden
object
error
string
some meaningful error messageNot found
object
error
string
some meaningful error messageInternal server error
object
error
string
some meaningful error message