OpenID authentification (#170)

* openid authentification

* openid middleware

* openId login

* tidied login page

* removed useless email text field
This commit is contained in:
Marco Piovanello
2024-07-23 19:04:05 +02:00
committed by GitHub
parent 38a0cedc9c
commit 92aabc0086
11 changed files with 259 additions and 8 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/marcopeocchi/yt-dlp-web-ui/server/config"
"github.com/marcopeocchi/yt-dlp-web-ui/server/internal"
middlewares "github.com/marcopeocchi/yt-dlp-web-ui/server/middleware"
"github.com/marcopeocchi/yt-dlp-web-ui/server/openid"
)
// Dependency injection container.
@@ -28,6 +29,9 @@ func ApplyRouter() func(chi.Router) {
if config.Instance().RequireAuth {
r.Use(middlewares.Authenticated)
}
if config.Instance().UseOpenId {
r.Use(openid.Middleware)
}
r.Get("/ws", WebSocket)
r.Post("/http", Post)
}