scute.sessions has two kinds of calls. Three take the user's own tokens and work without the secret key. Two take the secret key alone and need no user session.
With the user's tokens#
scute.sessions.current_user(access_token) # the signed-in user; fails for a revoked sessionscute.sessions.refresh(refresh_token) # new access (and refresh) tokensscute.sessions.sign_out(access_token) # ends this session; the user's other sessions stay| Method | Request | Header |
|---|---|---|
| current_user(access_token) | GET /v1/auth/:app_id/current_user | X-Authorization |
| refresh(refresh_token) | POST /v1/auth/:app_id/tokens/refresh | X-Refresh-Token |
| sign_out(access_token) | DELETE /v1/auth/:app_id/current_user | X-Authorization |
current_user asks Scute, so a revoked session fails with Scute::APIError. In a session someone started as the user, the answer also has impersonation (who and why).
With the secret key#
scute.sessions.list(user_id) # the user's sessions, an Arrayscute.sessions.revoke(user_id, session_id) # ends one session at once| Method | Request |
|---|---|
| list(user_id) | GET /v1/:app_id/users/:user_id/sessions |
| revoke(user_id, session_id) | DELETE /v1/:app_id/users/:user_id/sessions/:session_id |
A token from a revoked session still passes local verification until it expires. Verify with remote: true where that matters (see Verify tokens).