Skip to content

Commit

Permalink
fix: return mfa enabled in settings (#747)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangmingtay committed Oct 12, 2022
1 parent 243364b commit 8f2e09d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type Settings struct {
MailerAutoconfirm bool `json:"mailer_autoconfirm"`
PhoneAutoconfirm bool `json:"phone_autoconfirm"`
SmsProvider string `json:"sms_provider"`
MFAEnabled bool `json:"mfa_enabled"`
}

func (a *API) Settings(w http.ResponseWriter, r *http.Request) error {
Expand Down Expand Up @@ -63,5 +64,6 @@ func (a *API) Settings(w http.ResponseWriter, r *http.Request) error {
MailerAutoconfirm: config.Mailer.Autoconfirm,
PhoneAutoconfirm: config.Sms.Autoconfirm,
SmsProvider: config.Sms.Provider,
MFAEnabled: config.MFA.Enabled,
})
}
2 changes: 2 additions & 0 deletions api/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ func TestSettings_DefaultProviders(t *testing.T) {
resp := Settings{}
require.NoError(t, json.NewDecoder(w.Body).Decode(&resp))

require.False(t, resp.MFAEnabled)

p := resp.ExternalProviders

require.False(t, p.Phone)
Expand Down

0 comments on commit 8f2e09d

Please sign in to comment.