MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / LoadMFA

Function LoadMFA

core/app/auth/auth.go:188–199  ·  view source on GitHub ↗
(req dto.MfaRequest)

Source from the content-addressed store, hash-verified

186}
187
188func LoadMFA(req dto.MfaRequest) (mfa.Otp, error) {
189 settingRepo := repo.NewISettingRepo()
190 username, err := settingRepo.GetValueByKey("UserName")
191 if err != nil {
192 return mfa.Otp{}, err
193 }
194 otp, err := mfa.GetOtp(username, req.Title, req.Interval)
195 if err != nil {
196 return mfa.Otp{}, err
197 }
198 return otp, nil
199}
200func MFABind(req dto.MfaCredential) error {
201 success := mfa.ValidCode(req.Interval, req.Code, req.Secret)
202 if !success {

Callers

nothing calls this directly

Calls 1

GetValueByKeyMethod · 0.95

Tested by

no test coverage detected