Skip to content
This repository has been archived by the owner on Aug 4, 2018. It is now read-only.
Fingercomp edited this page Nov 22, 2016 · 5 revisions

We use so-called auth tickets that authorize you to the app. Those are just auth_tkt cookies.

Registration

Send POST request to /auth with the following body template:

{"nickname": "nickname",
 "password": "password",
 "email": "mail@provider.com",
 "action": "register"}

Responses

Status Comment
200 OK Account created successfully.
400 Bad Request An error occured.
Request Response
POST /auth HTTP/1.1
...

{"nickname": "user", "password": "passwd", "email": "user@example.com", "action": "register"}

HTTP/1.1 200 OK
...

{"success": true, "data": "Account created successfully!", "code": 200, ...}

POST /auth HTTP/1.1
...

{"nickname": "", "password": "", "email": "", "action": "register"}

HTTP/1.1 400 Bad Request
...

{"success": false, "code": 400, ...

Signing in

Send a POST request to /auth with the following body template:

{"nickname": "nickname",
 "password": "password",
 "action": "log-in"}

Responses

Status Comment
200 OK Logged in successfully.
400 Bad Request An error occured.

Several auth_tkt cookies are sent back via Set-Cookie headers when logged in.

Request Response
POST /auth HTTP/1.1
...

{"nickname": "user", "password": "passwd", "action": "log-in"}

HTTP/1.1 200 OK
Set-Cookie: auth_tkt;...
...

{"success": true, "code": 200, "data": "Logged in successfully.", ...}

POST /auth HTTP/1.1
...

{"nickname": "", "passwd": "", "action": "log-in"}

HTTP/1.1 400 Bad Request
...

{"success": false, "code": 400, ...}

Signing out

Requires authorization.

Send a POST request to /auth with the following body template:

{"action": "log-out"}

Responses

Status Comment
200 OK Logged out successfully.

Several Set-Cookie headers are sent when logged out. They clean out old auth ticket cookies.

Request Response
POST /auth HTTP/1.1
Cookie: auth_tkt;...
...

{"action": "log-out"}

HTTP/1.1 200 OK
Set-Cookie: ...
...

{"success": true, "code": 200, "data": "Logged out successfully.", ...}

Changes

Version Changes
3.0.1 Reissue tickets on every request.