Can disable auth

This commit is contained in:
2023-09-08 09:04:48 +02:00
parent 57c023b45b
commit bd5ea1fb23
6 changed files with 15 additions and 3 deletions

View File

@ -124,7 +124,7 @@ struct CurrentUser {
/// Get current authenticated user
pub async fn current_user(auth: AuthExtractor) -> impl Responder {
HttpResponse::Ok().json(CurrentUser {
id: auth.id().unwrap(),
id: auth.id().unwrap_or_else(|| "Anonymous".to_string()),
})
}