mirror of
https://github.com/PrivateCaptcha/PrivateCaptcha.git
synced 2026-02-09 15:28:49 -06:00
Cosmetic improvement
This commit is contained in:
@@ -158,17 +158,11 @@ func AuthenticateSuite(ctx context.Context, email string, srv *http.ServeMux, xs
|
||||
}
|
||||
cookie := resp.Cookies()[idx]
|
||||
|
||||
sess, err := sessions.Store.Read(ctx, cookie.Value, false /*skip cache*/)
|
||||
code, err := TwoFactorCodeFromSession(ctx, cookie.Value, sessions.Store)
|
||||
if err != nil {
|
||||
slog.ErrorContext(ctx, "Failed to read server session from session cookie", common.ErrAttr(err))
|
||||
return cookie, err
|
||||
}
|
||||
|
||||
code, ok := sess.Get(ctx, session.KeyTwoFactorCode).(int)
|
||||
if !ok {
|
||||
return nil, errors.New("2FA code not found in session")
|
||||
}
|
||||
|
||||
form = url.Values{}
|
||||
form.Add(common.ParamCSRFToken, xsrf.Token(email))
|
||||
form.Add(common.ParamEmail, email)
|
||||
|
||||
Reference in New Issue
Block a user