-
Notifications
You must be signed in to change notification settings - Fork 1
Authentication
Authentication is possible with
- Local Authentication
URL: /v1/register
Method: POST
-
first_name: The users first name. This will be the display name. -
email: The users email -
preferredLocale(optional) : This users language. By default the requests settings will be read.
On success this returns the user object and sends an email with the verification link. On failure, an error object is returned.
URL /v1/verify-email
Method: GET
-
email: The users email -
mailVerificationCode: The verification code -
password: The desired password [Min: 8, Max: 255]
Returns {success: true} on a success and an error object on failure.
URL: /v1/auth/local/login/:app_id
Method: POST
Parameters:
-
username: The users email -
password: The users password
The app_id is required because simply doing res.header("Access-Control-Allow-Origin", "*"); would enable hackers to perform CSRF by for example calling /v1/auth/google/login in a hidden ajax request / iframe and then simply retrieving the auth token if the user was already logged in.
URL: /v1/auth/{facebook|twitter|google}/login/:app_id
Method: GET
Parameters: None
All authentication methods will do a GET-Request on the callback URL with the following parameters:
- success (boolean) Whether the authentication succeeded.
- authToken (String) The auth token.
- error (Object) An error object on failure or
nullon success