From 00cceca1041517503f2ae312e20e257d8d311219 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 19 Aug 2020 13:35:21 -0400 Subject: [PATCH] Update signup-via-invite page This updates signup.tmpl to include all supported OAuth methods and respect the new `DisablePasswordAuth` config value. --- invites.go | 8 ++++---- pages/signup.tmpl | 21 +++------------------ 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/invites.go b/invites.go index 10416b2..4e3eff4 100644 --- a/invites.go +++ b/invites.go @@ -170,14 +170,14 @@ func handleViewInvite(app *App, w http.ResponseWriter, r *http.Request) error { p := struct { page.StaticPage + *OAuthButtons Error string Flashes []template.HTML Invite string - OAuth *OAuthButtons }{ - StaticPage: pageForReq(app, r), - Invite: inviteCode, - OAuth: NewOAuthButtons(app.cfg), + StaticPage: pageForReq(app, r), + OAuthButtons: NewOAuthButtons(app.cfg), + Invite: inviteCode, } if expired { diff --git a/pages/signup.tmpl b/pages/signup.tmpl index c17aee3..b1bb50d 100644 --- a/pages/signup.tmpl +++ b/pages/signup.tmpl @@ -70,25 +70,9 @@ form dd { {{end}}
- {{ if or .OAuth.SlackEnabled .OAuth.WriteAsEnabled .OAuth.GitLabEnabled }} -
- {{ if .OAuth.SlackEnabled }} - Sign in with Slack - {{ end }} - {{ if .OAuth.WriteAsEnabled }} - Sign in with Write.as - {{ end }} - {{ if .OAuth.GitLabEnabled }} - Sign in with {{.OAuth.GitLabDisplayName}} - {{ end }} -
- -
-

or

-
-
- {{ end }} + {{template "oauth-buttons" .}} + {{if not .DisablePasswordAuth}}
@@ -112,6 +96,7 @@ form dd {
+ {{end}}
{{ end }}