1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-07-06 15:52:48 +00:00

Can sign out user

This commit is contained in:
2021-05-12 18:50:02 +02:00
parent cf5ed7ddde
commit c545838f3c
2 changed files with 8 additions and 0 deletions

View File

@ -39,6 +39,13 @@ pub fn auth_with_reset_token(r: &mut HttpRequestHandler) -> RequestResult {
r.set_response(AdminAuthSuccess::new(token))
}
/// Sign out current admin
pub fn sign_out(r: &mut HttpRequestHandler) -> RequestResult {
admin_access_token_helper::destroy(r.admin_id()?)?;
r.ok()
}
/// Get current admin ID
pub fn get_admin_id(r: &mut HttpRequestHandler) -> RequestResult {
r.set_response(AdminIDAPI::new(r.admin_id()?))