Adding response to 2FA

This commit is contained in:
2024-06-19 21:34:50 +07:00
parent b890f5442c
commit c1059072a6
7 changed files with 141 additions and 0 deletions

View File

@ -176,6 +176,14 @@ func GetSession(r *http.Request) (UserStatus, types.User, string) {
return Unauthorized, types.User{}, ""
}
if !userSession.Authenticated && userSession.Totp != "" {
return Unauthorized, userSession, cookie.Value
}
if !userSession.Authenticated {
return Unauthorized, types.User{}, ""
}
return Authorized, userSession, cookie.Value
}