Skip to content

Commit cb6b4c2

Browse files
committed
Change to Skip Local 2fa instead of Override Local 2fa
Signed-off-by: Andrew Thornton <[email protected]>
1 parent ceaf11c commit cb6b4c2

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

cmd/admin.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ var (
289289
Usage: "Custom icon URL for OAuth2 login source",
290290
},
291291
cli.BoolFlag{
292-
Name: "override-local-2fa",
293-
Usage: "Set to true to override local 2fa settings",
292+
Name: "skip-local-2fa",
293+
Usage: "Set to true to skip local 2fa for users authenticated by this source",
294294
},
295295
}
296296

@@ -620,7 +620,7 @@ func parseOAuth2Config(c *cli.Context) *oauth2.Source {
620620
OpenIDConnectAutoDiscoveryURL: c.String("auto-discover-url"),
621621
CustomURLMapping: customURLMapping,
622622
IconURL: c.String("icon-url"),
623-
OverrideLocalTwoFA: c.Bool("override-local-2fa"),
623+
SkipLocalTwoFA: c.Bool("skip-local-2fa"),
624624
}
625625
}
626626

options/locale/locale_en-US.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,8 +2448,8 @@ auths.oauth2_tokenURL = Token URL
24482448
auths.oauth2_authURL = Authorize URL
24492449
auths.oauth2_profileURL = Profile URL
24502450
auths.oauth2_emailURL = Email URL
2451-
auths.override_local_two_fa = Override local 2FA
2452-
auths.override_local_two_fa_helper = Leaving unset means local users with 2FA set will still have to pass 2FA to log on
2451+
auths.skip_local_two_fa = Skip local 2FA
2452+
auths.skip_local_two_fa_helper = Leaving unset means local users with 2FA set will still have to pass 2FA to log on
24532453
auths.oauth2_tenant = Tenant
24542454
auths.enable_auto_register = Enable Auto Registration
24552455
auths.sspi_auto_create_users = Automatically create users

routers/web/admin/auths.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func parseOAuth2Config(form forms.AuthenticationForm) *oauth2.Source {
181181
OpenIDConnectAutoDiscoveryURL: form.OpenIDConnectAutoDiscoveryURL,
182182
CustomURLMapping: customURLMapping,
183183
IconURL: form.Oauth2IconURL,
184-
OverrideLocalTwoFA: form.OverrideLocalTwoFA,
184+
SkipLocalTwoFA: form.SkipLocalTwoFA,
185185
}
186186
}
187187

routers/web/user/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ func handleOAuth2SignIn(ctx *context.Context, source *models.LoginSource, u *mod
706706
updateAvatarIfNeed(gothUser.AvatarURL, u)
707707

708708
needs2FA := false
709-
if !source.Cfg.(*oauth2.Source).OverrideLocalTwoFA {
709+
if !source.Cfg.(*oauth2.Source).SkipLocalTwoFA {
710710
_, err := models.GetTwoFactorByUID(u.ID)
711711
if err != nil && !models.IsErrTwoFactorNotEnrolled(err) {
712712
ctx.ServerError("UserSignIn", err)

services/auth/source/oauth2/source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type Source struct {
2424
OpenIDConnectAutoDiscoveryURL string
2525
CustomURLMapping *CustomURLMapping
2626
IconURL string
27-
OverrideLocalTwoFA bool
27+
SkipLocalTwoFA bool
2828

2929
// reference to the loginSource
3030
loginSource *models.LoginSource

services/forms/auth_form.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ type AuthenticationForm struct {
6666
Oauth2EmailURL string
6767
Oauth2IconURL string
6868
Oauth2Tenant string
69-
OverrideLocalTwoFA bool
69+
SkipLocalTwoFA bool
7070
SSPIAutoCreateUsers bool
7171
SSPIAutoActivateUsers bool
7272
SSPIStripDomainNames bool

templates/admin/auth/edit.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@
257257
</div>
258258
<div class="optional field">
259259
<div class="ui checkbox">
260-
<label for="override_local_two_fa"><strong>{{.i18n.Tr "admin.auths.override_local_two_fa"}}</strong></label>
261-
<input id="override_local_two_fa" name="override_local_two_fa" type="checkbox" {{if $cfg.OverrideLocalTwoFA}}checked{{end}}>
262-
<p class="help">{{.i18n.Tr "admin.auths.override_local_two_fa_helper"}}</p>
260+
<label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
261+
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}>
262+
<p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
263263
</div>
264264
</div>
265265

templates/admin/auth/source/oauth.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
</div>
3131
<div class="optional field">
3232
<div class="ui checkbox">
33-
<label for="override_local_two_fa"><strong>{{.i18n.Tr "admin.auths.override_local_two_fa"}}</strong></label>
34-
<input id="override_local_two_fa" name="override_local_two_fa" type="checkbox" {{if .override_local_two_fa}}checked{{end}}>
35-
<p class="help">{{.i18n.Tr "admin.auths.override_local_two_fa_helper"}}</p>
33+
<label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
34+
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}>
35+
<p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
3636
</div>
3737
</div>
3838

0 commit comments

Comments
 (0)