mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Set TOTP issuer to Casdoor
This commit is contained in:
parent
0fe34c2f53
commit
32a8a028d5
@ -19,7 +19,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/beego/beego"
|
|
||||||
"github.com/beego/beego/context"
|
"github.com/beego/beego/context"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/pquerna/otp"
|
"github.com/pquerna/otp"
|
||||||
@ -39,10 +38,11 @@ type TotpMfa struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (mfa *TotpMfa) Initiate(ctx *context.Context, userId string) (*MfaProps, error) {
|
func (mfa *TotpMfa) Initiate(ctx *context.Context, userId string) (*MfaProps, error) {
|
||||||
issuer := beego.AppConfig.String("appname")
|
//issuer := beego.AppConfig.String("appname")
|
||||||
if issuer == "" {
|
//if issuer == "" {
|
||||||
issuer = "casdoor"
|
// issuer = "casdoor"
|
||||||
}
|
//}
|
||||||
|
issuer := "casdoor"
|
||||||
|
|
||||||
key, err := totp.Generate(totp.GenerateOpts{
|
key, err := totp.Generate(totp.GenerateOpts{
|
||||||
Issuer: issuer,
|
Issuer: issuer,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user