Display a form to create an Opengist account coming from a OAuth provider (#623)

This commit is contained in:
Thomas Miceli
2026-02-08 15:32:24 +07:00
committed by GitHub
parent ce39df1030
commit 7b1048ec30
12 changed files with 362 additions and 82 deletions

View File

@@ -199,6 +199,17 @@ func inMFASession(next Handler) Handler {
}
}
func inOAuthRegisterSession(next Handler) Handler {
return func(ctx *context.Context) error {
sess := ctx.GetSession()
_, ok := sess.Values["oauthProvider"].(string)
if !ok {
return ctx.RedirectTo("/login")
}
return next(ctx)
}
}
func makeCheckRequireLogin(isSingleGistAccess bool) Middleware {
return func(next Handler) Handler {
return func(ctx *context.Context) error {