Skip to content
Snippets Groups Projects
Commit c7d4275f authored by Alexis Poyen's avatar Alexis Poyen
Browse files

Feat : Handle users for election

parent 67fde387
No related branches found
No related tags found
1 merge request!3Feat : Handle users for election
Pipeline #5275 passed
HOSTNAME=elections.127.0.0.1.nip.io HOSTNAME=elections.127.0.0.1.nip.io
ADMIN_GROUP=ADMINS ADMIN_GROUP=ADMINS
CLIENT_GROUP=VISUALIZER VISUALIZER_GROUP=VISUALIZER
# Needed to user OAuth2 authentication : # Needed to user OAuth2 authentication :
REDIRECT_URL=https://${HOSTNAME}/OAuth2Callback REDIRECT_URL=https://${HOSTNAME}/OAuth2Callback
......
...@@ -163,8 +163,8 @@ func (d *DataHandler) addUserInMemory(userOauth2 UserOAuth2) (User, error) { ...@@ -163,8 +163,8 @@ func (d *DataHandler) addUserInMemory(userOauth2 UserOAuth2) (User, error) {
for _, userRole := range userOauth2.Groups { for _, userRole := range userOauth2.Groups {
if userRole != "" && (userRole == os.Getenv("ADMIN_GROUP")) { if userRole != "" && (userRole == os.Getenv("ADMIN_GROUP")) {
user.Role = "ADMIN" user.Role = "ADMIN"
} else if userRole != "" && (userRole == os.Getenv("CLIENT_GROUP")) { } else if userRole != "" && (userRole == os.Getenv("VISUALIZER_GROUP")) {
user.Role = "CLIENT" user.Role = "VISUALIZER"
} else { } else {
return user, errors.New("user not in an app group") return user, errors.New("user not in an app group")
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment