|
|
1 mēnesi atpakaļ | |
|---|---|---|
| .. | ||
| README.md | 1 mēnesi atpakaļ | |
| clear_sessions.md | 1 mēnesi atpakaļ | |
| login.md | 1 mēnesi atpakaļ | |
| logout.md | 1 mēnesi atpakaļ | |
| status.md | 1 mēnesi atpakaļ | |
How sessions work. Login to get a token, send it on every request, logout when done.
Not that hard see?
POST /auth/login authenticate and get a session tokenPOST /auth/logout kill yourselfGET /auth/status check if your session is still alive and when it kills itselfPOST /auth/clear-sessions adminier: nuke all sessions for a specific user/auth/login with credentials using ur sign in methodick.Authorization: Bearer <token> on every damn request after that/auth/logout to kill yourselfSessions should optionally be able to persist across server restarts (server should only store a hash of the token in the database, never the raw token itself obviously). On restart it loads them hash brownies back.
Each user should have a max number of concurrent sessions (configurable). When you go over the limit the oldest session gets deported to hell automatically to make room for the new one.