Authentication
Login user (project-based)
When the project has **requireEmailVerification** enabled and the user has not verified their email, returns 403 with code **EMAIL_VERIFICATION_REQUIRED** (user must verify email first, then login again).
POST
/api/auth/local/loginSDK setup
Create a client instance. No authentication is required for this endpoint.
import { Configuration, AuthenticationApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
});
const authentication = new AuthenticationApi(configuration);import { Configuration, AuthenticationApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
});
const authentication = new AuthenticationApi(configuration);Example request
Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.
const { data: result } = await authentication.loginLocalUser(
{
email: "marcos.fahey@northwind.dev",
password: "Str0ng_Sample_Pass!w0rd",
projectId: "usr_9sGXZhs6MYpPUf"
}
);const { data: result } = await authentication.loginLocalUser(
{
email: "marcos.fahey@northwind.dev",
password: "Str0ng_Sample_Pass!w0rd",
projectId: "usr_9sGXZhs6MYpPUf"
}
);Playground
liveTest this endpoint with your own credentials. Your requests will be sent to the live API.
No Request Yet
Send a request to see the full inspector
Authentication
Public — No Auth Required
Request Body
json
{
"email": "amari_koss69@northwind.dev",
"password": "Str0ng_Sample_Pass!w0rd",
"projectId": "proj_qh5hFHNT70YZ"
}{
"email": "amari_koss69@northwind.dev",
"password": "Str0ng_Sample_Pass!w0rd",
"projectId": "proj_qh5hFHNT70YZ"
}Responses
200Login successful
json
{
"message": "Login successful",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 1800,
"user": {
"id": "685acbe0e129932fbb7a0fc2",
"email": "john.doe@mudbase.dev",
"firstName": "John",
"lastName": "Doe",
"role": "developer",
"emailVerified": true,
"twoFactorEnabled": false
}
}{
"message": "Login successful",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 1800,
"user": {
"id": "685acbe0e129932fbb7a0fc2",
"email": "john.doe@mudbase.dev",
"firstName": "John",
"lastName": "Doe",
"role": "developer",
"emailVerified": true,
"twoFactorEnabled": false
}
}401—
403Email verification required (project has requireEmailVerification and user has not verified)
json
{
"error": "Email verification required",
"code": "EMAIL_VERIFICATION_REQUIRED",
"message": "Please verify your email to sign in. Check your inbox for the verification link."
}{
"error": "Email verification required",
"code": "EMAIL_VERIFICATION_REQUIRED",
"message": "Please verify your email to sign in. Check your inbox for the verification link."
}429—
500—
Errors
| Code | Meaning |
|---|---|
401 | — |
403 | Email verification required (project has requireEmailVerification and user has not verified) |
429 | — |
500 | — |