Account and session
Register
The registration of a new account is done thru the /v3/oauth/register endpoint from the api, the endpoint suports 2 methods, GET and POST
GET
This method is used to render the register page as shown below
This method doesn't need any authentication to access, if there is an active session stored in the cookie then the server redirect the user to the main dashboard
POST
This method is used to register a new user and doesn't need any authorization The request only is valid if all the body JSON params is passed, being these params:
name
"Diogo"
The user registration name
surname
"Nunes"
The user registration surname
username
"poposa"
The user registration username
user_password
"imgay123"
The user registration password
password_confirm
"imgay123"
Password confirm, must be the same value as the user_password value or else the request will be invalid
In Nodejs the body json would look something like this:
In case of success it will return a redirect to the login page with a query named register with the value success
In case of an error it will render de register page with an error message
This request could be done in Nodejs like this:
Login
The login to an account is done thru the /v3/oauth/login endpoint from the api, the endpoint suports 2 methods, GET and POST
GET
This method is used to render the login page as shown below
This method accept a redirectTo query value, after the login is done the server will redirect to the page passed in this query but if there is no value defined then it will redirect, by default, to the dashboard
This method doesn't need any authentication to access, if there is an active session stored in the cookie then the server just redirect to the passed page or to the dashboard
POST
This method is used to login and create a session and doesn't need any authorization The request only is valid if the required body JSON params is passed, being valid the params:
login
"poposa"
The username or email refering to the account
password
"imgay123"
The password to the account
redirectTo
"/v3/developer"
The page to redirect after the successful login
In Nodejs the body json would look something like this:
In case of success there is two possibilities:
2FA required
2FA not required
If the account doesn't require two-factor authentication then the server will return a redirect with a Set-Cookie header to the NextFUR-SessionID cookie
This cookie has the SessionID to the created session
In case of an error it will render de login page with a error message
Logout
Logout of a session
GET
POST
METHOD: POST
AUTH: TRUE
AUTH TYPE: `USER AUTH`
ENDPOINT: /v3/oauth/logout
HEADER:
BODY:
To logout you need to have a valid session both to logout and to make the request;
{
'session': "<Session To Logout>"
}
RETURNS (200)
{ success: true }
Check (POST)
Check if the session is Authenticated
METHOD: POST
AUTH: TRUE
AUTH TYPE: `SERVER TOKEN`
ENDPOINT: /v3/oauth/check
HEADER:
BODY:
{
'token': "<Session To Check>"
}
RETURNS
Last updated