mirror of
https://github.com/1f349/lavender.git
synced 2025-04-14 06:55:55 +01:00
Fix OTP form implementation
This commit is contained in:
parent
900c220a84
commit
49cf77d681
@ -22,6 +22,7 @@ type otpLoginDB interface {
|
||||
}
|
||||
|
||||
var _ auth.Provider = (*OtpLogin)(nil)
|
||||
var _ auth.Form = (*OtpLogin)(nil)
|
||||
|
||||
type OtpLogin struct {
|
||||
DB otpLoginDB
|
||||
@ -29,9 +30,9 @@ type OtpLogin struct {
|
||||
|
||||
func (o *OtpLogin) AccessState() process.State { return process.StateBasic }
|
||||
|
||||
func (o *OtpLogin) Name() string { return "basic" }
|
||||
func (o *OtpLogin) Name() string { return "otp" }
|
||||
|
||||
func (o *OtpLogin) RenderTemplate(ctx authContext.FormContext) error {
|
||||
func (o *OtpLogin) RenderTemplate(ctx authContext.TemplateContext) error {
|
||||
user := ctx.User()
|
||||
if user == nil || user.Subject == "" {
|
||||
return fmt.Errorf("requires previous factor")
|
||||
|
Loading…
x
Reference in New Issue
Block a user