Function logout
Source pub fn logout(
db: &Database,
refresh_token: Option<&str>,
) -> Result<(), (u16, &'static str)>
Expand description
/logout
If this is successful, delete the cookie storing the refresh token
§Errors
- 401: Invalid session
- 401: Invalid token
- 500: Could not delete session
§Panics
- could not connect to database
TODO: don’t panic if db connection fails, just return an error