mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-27 23:45:45 +08:00
NET-1227: Fix Singup Flow with Github SSO (#3078)
* add list roles to pro and ce * if not pro set user role to admin * validate update user * add separate validation check for password on update * remove validate check * fix github SSO with invite signup
This commit is contained in:
parent
0a1558d5ac
commit
9ac78e15bc
1 changed files with 3 additions and 3 deletions
|
@ -67,10 +67,9 @@ func handleGithubCallback(w http.ResponseWriter, r *http.Request) {
|
|||
handleOauthNotConfigured(w)
|
||||
return
|
||||
}
|
||||
|
||||
var inviteExists bool
|
||||
// check if invite exists for User
|
||||
in, err := logic.GetUserInvite(content.Login)
|
||||
in, err := logic.GetUserInvite(content.Email)
|
||||
if err == nil {
|
||||
inviteExists = true
|
||||
}
|
||||
|
@ -89,11 +88,12 @@ func handleGithubCallback(w http.ResponseWriter, r *http.Request) {
|
|||
logic.ReturnErrorResponse(w, r, logic.FormatError(err, "internal"))
|
||||
return
|
||||
}
|
||||
user.UserName = content.Login // overrides email with github id
|
||||
if err = logic.CreateUser(&user); err != nil {
|
||||
handleSomethingWentWrong(w)
|
||||
return
|
||||
}
|
||||
logic.DeleteUserInvite(user.UserName)
|
||||
logic.DeleteUserInvite(content.Email)
|
||||
logic.DeletePendingUser(content.Login)
|
||||
} else {
|
||||
if !isEmailAllowed(content.Login) {
|
||||
|
|
Loading…
Add table
Reference in a new issue