Browse Source

fix(go): remove auth provider when removing idp integration;

Vishal Dalwadi 4 months ago
parent
commit
4475d3652f
2 changed files with 7 additions and 0 deletions
  1. 5 0
      pro/auth/auth.go
  2. 2 0
      pro/controllers/users.go

+ 5 - 0
pro/auth/auth.go

@@ -93,6 +93,11 @@ func InitializeAuthProvider() string {
 	return authInfo[0]
 }
 
+// RemoveAuthProvider remove the auth provider configuration.
+func RemoveAuthProvider() {
+	auth_provider = nil
+}
+
 // HandleAuthCallback - handles oauth callback
 // Note: not included in API reference as part of the OAuth process itself.
 func HandleAuthCallback(w http.ResponseWriter, r *http.Request) {

+ 2 - 0
pro/controllers/users.go

@@ -1459,6 +1459,8 @@ func removeIDPIntegration(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 
+	proAuth.RemoveAuthProvider()
+
 	go func() {
 		err := proAuth.SyncFromIDP()
 		if err != nil {