NET-811: block normal user login from accessing dashboard (#2724)

* block normal user login from accessing dashboard

* header change

* allow from ui header

* allow from ui header

* check for user role after decoding

* block oauth login for normal user

* handle other oauth provider callback funcs for user login
This commit is contained in:
Abhishek K
2023-12-20 09:08:55 +04:00
committed by GitHub
parent 72f84c1355
commit b69bf60160
7 changed files with 77 additions and 2 deletions

View File

@@ -66,6 +66,15 @@ func handleGithubCallback(w http.ResponseWriter, r *http.Request) {
return
}
}
user, err := logic.GetUser(content.Email)
if err != nil {
handleOauthUserNotFound(w)
return
}
if !(user.IsSuperAdmin || user.IsAdmin) {
handleOauthUserNotAllowed(w)
return
}
var newPass, fetchErr = fetchPassValue("")
if fetchErr != nil {
return