@@ -218,23 +218,26 @@ func InitEnv() {
218218 constants .DISABLE_MAGIC_LINK_LOGIN = true
219219 }
220220
221- rolesSplit := strings .Split (os .Getenv ("ROLES" ), "," )
221+ rolesEnv := strings .TrimSpace (os .Getenv ("ROLES" ))
222+ rolesSplit := strings .Split (rolesEnv , "," )
222223 roles := []string {}
223- if len (rolesSplit ) == 0 {
224+ if len (rolesEnv ) == 0 {
224225 roles = []string {"user" }
225226 }
226227
227- defaultRoleSplit := strings .Split (os .Getenv ("DEFAULT_ROLES" ), "," )
228+ defaultRolesEnv := strings .TrimSpace (os .Getenv ("DEFAULT_ROLES" ))
229+ defaultRoleSplit := strings .Split (defaultRolesEnv , "," )
228230 defaultRoles := []string {}
229231
230- if len (defaultRoleSplit ) == 0 {
232+ if len (defaultRolesEnv ) == 0 {
231233 defaultRoles = []string {"user" }
232234 }
233235
234- protectedRolesSplit := strings .Split (os .Getenv ("PROTECTED_ROLES" ), "," )
236+ protectedRolesEnv := strings .TrimSpace (os .Getenv ("PROTECTED_ROLES" ))
237+ protectedRolesSplit := strings .Split (protectedRolesEnv , "," )
235238 protectedRoles := []string {}
236239
237- if len (protectedRolesSplit ) > 0 {
240+ if len (protectedRolesEnv ) > 0 {
238241 for _ , val := range protectedRolesSplit {
239242 trimVal := strings .TrimSpace (val )
240243 protectedRoles = append (protectedRoles , trimVal )
0 commit comments