fix(09): WR-10 keep cabana's own backend guard when it is activated twice on one application
This commit is contained in:
@@ -54,6 +54,16 @@ func (reg *Registry) Register(pluginID, name string, g any) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Owner returns the plugin ID that registered the guard name. The second
|
||||
// result is false when no guard has that name.
|
||||
func (reg *Registry) Owner(name string) (string, bool) {
|
||||
if reg == nil {
|
||||
return "", false
|
||||
}
|
||||
ng, ok := reg.guards[name]
|
||||
return ng.pluginID, ok
|
||||
}
|
||||
|
||||
// Middleware derives an http middleware from a registered guard. Unknown
|
||||
// names fail (fail boot, mirrors surf.RegisterMiddleware's contract).
|
||||
// On Authenticate/AuthenticateCredential success: WithUser (+WithCredential
|
||||
|
||||
Reference in New Issue
Block a user