mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
feat: Add option to disable local auth form
This commit is contained in:
parent
59dac15bdf
commit
770cc1dbb3
10 changed files with 68 additions and 11 deletions
|
@ -7,6 +7,7 @@ import (
|
|||
"log/slog"
|
||||
"net/http"
|
||||
|
||||
"miniflux.app/v2/internal/config"
|
||||
"miniflux.app/v2/internal/http/request"
|
||||
"miniflux.app/v2/internal/http/response/html"
|
||||
"miniflux.app/v2/internal/http/route"
|
||||
|
@ -15,6 +16,14 @@ import (
|
|||
)
|
||||
|
||||
func (h *handler) oauth2Unlink(w http.ResponseWriter, r *http.Request) {
|
||||
if config.Opts.DisableLocalAuth() {
|
||||
slog.Warn("blocking oauth2 unlink attempt, local auth is disabled",
|
||||
slog.String("user_agent", r.UserAgent()),
|
||||
)
|
||||
html.Redirect(w, r, route.Path(h.router, "login"))
|
||||
return
|
||||
}
|
||||
|
||||
printer := locale.NewPrinter(request.UserLanguage(r))
|
||||
provider := request.RouteStringParam(r, "provider")
|
||||
if provider == "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue