Parcourir la source

auth: invalidate every token in disabling auth

Hitoshi Mitake il y a 9 ans
Parent
commit
66107b8653
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      auth/store.go

+ 4 - 0
auth/store.go

@@ -184,6 +184,10 @@ func (as *authStore) AuthDisable() {
 	as.enabled = false
 	as.enabledMu.Unlock()
 
+	as.simpleTokensMu.Lock()
+	as.simpleTokens = make(map[string]string) // invalidate all tokens
+	as.simpleTokensMu.Unlock()
+
 	plog.Noticef("Authentication disabled")
 }