Browse Source

check if user exists, handle oauth not configured for host SSO

abhishek9686 1 year ago
parent
commit
bb5ad8a241
1 changed files with 2 additions and 2 deletions
  1. 2 2
      auth/register_callback.go

+ 2 - 2
auth/register_callback.go

@@ -75,8 +75,8 @@ func HandleHostSSOCallback(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 	if !user.IsAdmin && !user.IsSuperAdmin {
-		response := returnErrTemplate("", "only admin users can register using SSO", state, reqKeyIf)
-		w.WriteHeader(http.StatusInternalServerError)
+		response := returnErrTemplate(userClaims.getUserName(), "only admin users can register using SSO", state, reqKeyIf)
+		w.WriteHeader(http.StatusForbidden)
 		w.Write(response)
 		return
 	}