mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-11-01 10:56:31 +08:00
feature (sso): authentication middleware
This commit is contained in:
@ -84,3 +84,13 @@ func AdminBackend(ctx App, res http.ResponseWriter, req *http.Request) {
|
||||
SendSuccessResultWithEtagAndGzip(res, req, backends)
|
||||
return
|
||||
}
|
||||
|
||||
func AdminAuthenticationMiddleware(ctx App, res http.ResponseWriter, req *http.Request) {
|
||||
drivers := Hooks.All.AuthenticationMiddleware()
|
||||
middlewares := make(map[string]Form, len(drivers))
|
||||
for id, driver := range drivers {
|
||||
middlewares[id] = driver.Setup()
|
||||
}
|
||||
SendSuccessResultWithEtagAndGzip(res, req, middlewares)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user