Add tokens routes
This commit is contained in:
@@ -2,7 +2,7 @@ use crate::app_config::AppConfig;
|
||||
use crate::controllers::{HttpFailure, HttpResult};
|
||||
use crate::extractors::auth_extractor::{AuthExtractor, AuthenticatedMethod};
|
||||
use crate::extractors::money_session::MoneySession;
|
||||
use crate::services::users_service;
|
||||
use crate::services::{tokens_service, users_service};
|
||||
use actix_remote_ip::RemoteIP;
|
||||
use actix_web::{HttpResponse, web};
|
||||
use light_openid::primitives::OpenIDConfig;
|
||||
@@ -118,6 +118,10 @@ pub async fn sign_out(auth: AuthExtractor, session: MoneySession) -> HttpResult
|
||||
session.unset_current_user()?;
|
||||
}
|
||||
|
||||
AuthenticatedMethod::Token(token) => {
|
||||
tokens_service::delete(token.user_id(), token.id()).await?;
|
||||
}
|
||||
|
||||
AuthenticatedMethod::Dev => {
|
||||
// Nothing to be done, user is always authenticated
|
||||
}
|
||||
|
Reference in New Issue
Block a user