Can disable auth
This commit is contained in:
@ -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()),
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user