Authentication
Login
login
No authentication needed Frontend can be closed, restricted or open
Login using either a local or an online account. Supply optional security code to promote user.
Request
{
username: 'hello',
password: 'superpassword',
securityCode: 134455
}
Response
{
token: '', // To be used in requests when needed
username: 'hello',
role: 'admin', // guest, user or admin (local role)
onlineToken: '' // Only present if the user is online
}
Response
{
code: 401,
message: {
code: 'LOG_ERROR'
}
}
Login as Guest
loginGuest
No authentication needed Frontend needs to be open
Login as a random guest account. If `Frontend.AllowCustomTemporaryGuests` is enabled, you can send a `name` property to name your own guest.
Request
{
name: 'Alex Teriyaki The Second'
}
Response
{
token: '', // To be used in requests when needed
username: 'hello',
role: 'guest', // guest, user or admin (local role)
}
Response
{
code: 500,
message: {
code: 'NO_MORE_GUESTS_AVAILABLE'
}
}
Response
{
code: 403,
message: {
code: 'GUESTS_NOT_ALLOWED'
}
}
Check Auth Token
checkAuth
No authentication needed Frontend can be closed, restricted or open
Verify if your token is still valid.
Request
{
// Empty payload, just pass your tokens
}
Response
{
token: '', // To be used in requests when needed
username: 'hello',
role: 'guest', // guest, user or admin (local role)
}
Response
{
code: 500,
message: {
code: 'NO_MORE_GUESTS_AVAILABLE'
}
}