mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-06 11:56:39 +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)
|
handleOauthNotConfigured(w)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var inviteExists bool
|
var inviteExists bool
|
||||||
// check if invite exists for User
|
// check if invite exists for User
|
||||||
in, err := logic.GetUserInvite(content.Login)
|
in, err := logic.GetUserInvite(content.Email)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
inviteExists = true
|
inviteExists = true
|
||||||
}
|
}
|
||||||
|
@ -89,11 +88,12 @@ func handleGithubCallback(w http.ResponseWriter, r *http.Request) {
|
||||||
logic.ReturnErrorResponse(w, r, logic.FormatError(err, "internal"))
|
logic.ReturnErrorResponse(w, r, logic.FormatError(err, "internal"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
user.UserName = content.Login // overrides email with github id
|
||||||
if err = logic.CreateUser(&user); err != nil {
|
if err = logic.CreateUser(&user); err != nil {
|
||||||
handleSomethingWentWrong(w)
|
handleSomethingWentWrong(w)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
logic.DeleteUserInvite(user.UserName)
|
logic.DeleteUserInvite(content.Email)
|
||||||
logic.DeletePendingUser(content.Login)
|
logic.DeletePendingUser(content.Login)
|
||||||
} else {
|
} else {
|
||||||
if !isEmailAllowed(content.Login) {
|
if !isEmailAllowed(content.Login) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue