fix: incorrect status of enabled 2fa of user #577

This commit is contained in:
Jacky 2024-09-26 12:57:34 +08:00
parent f2a586ca78
commit 2f7070377f
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
4 changed files with 31 additions and 11 deletions

View file

@ -60,6 +60,13 @@ func (c *ConfigPayload) mkCertificateDir() (err error) {
}
}
if _, err = os.Stat(c.CertificateDir); os.IsNotExist(err) {
err = os.MkdirAll(c.CertificateDir, 0755)
if err == nil {
return nil
}
}
// For windows, replace * with # (issue #403)
c.CertificateDir = strings.ReplaceAll(c.CertificateDir, "*", "#")
if _, err = os.Stat(c.CertificateDir); os.IsNotExist(err) {