Fix: signup methods mutually exclusive

pull/317/head
prichier 4 years ago
parent d3f1e40010
commit ab285644a0
  1. 2
      account.go
  2. 2
      database.go
  3. 3
      pages/landing.tmpl

@ -325,8 +325,8 @@ func viewLogin(app *App, w http.ResponseWriter, r *http.Request) error {
app.Config().SlackOauth.ClientID != "", app.Config().SlackOauth.ClientID != "",
app.Config().WriteAsOauth.ClientID != "", app.Config().WriteAsOauth.ClientID != "",
app.Config().GitlabOauth.ClientID != "", app.Config().GitlabOauth.ClientID != "",
app.Config().GenericOauth.ClientID != "",
config.OrDefaultString(app.Config().GenericOauth.DisplayName, genericOauthDisplayName), config.OrDefaultString(app.Config().GenericOauth.DisplayName, genericOauthDisplayName),
app.Config().GenericOauth.ClientID != "",
config.OrDefaultString(app.Config().GitlabOauth.DisplayName, gitlabDisplayName), config.OrDefaultString(app.Config().GitlabOauth.DisplayName, gitlabDisplayName),
app.Config().GiteaOauth.ClientID != "", app.Config().GiteaOauth.ClientID != "",
config.OrDefaultString(app.Config().GiteaOauth.DisplayName, giteaDisplayName), config.OrDefaultString(app.Config().GiteaOauth.DisplayName, giteaDisplayName),

@ -20,8 +20,6 @@ import (
"strings" "strings"
"time" "time"
wf_db "github.com/writeas/writefreely/db"
"github.com/guregu/null" "github.com/guregu/null"
"github.com/guregu/null/zero" "github.com/guregu/null/zero"
uuid "github.com/nu7hatch/gouuid" uuid "github.com/nu7hatch/gouuid"

@ -78,7 +78,6 @@ form dd {
<div{{if not .OpenRegistration}} style="padding: 2em 0;"{{end}}> <div{{if not .OpenRegistration}} style="padding: 2em 0;"{{end}}>
{{ if .OpenRegistration }} {{ if .OpenRegistration }}
{{if .DisablePasswordAuth}}
{{ if or .OauthSlack .OauthWriteAs .OauthGitlab .OauthGeneric }} {{ if or .OauthSlack .OauthWriteAs .OauthGitlab .OauthGeneric }}
{{ if .OauthSlack }} {{ if .OauthSlack }}
<div class="row content-container signinbtns signinoauthbtns"><a class="loginbtn" href="/oauth/slack"><img alt="Sign in with Slack" height="40" width="172" src="/img/sign_in_with_slack.png" srcset="/img/sign_in_with_slack.png 1x, /img/sign_in_with_slack@2x.png 2x" /></a></div> <div class="row content-container signinbtns signinoauthbtns"><a class="loginbtn" href="/oauth/slack"><img alt="Sign in with Slack" height="40" width="172" src="/img/sign_in_with_slack.png" srcset="/img/sign_in_with_slack.png 1x, /img/sign_in_with_slack@2x.png 2x" /></a></div>
@ -93,7 +92,7 @@ form dd {
<div class="row content-container signinbtns signinoauthbtns"><a class="btn cta loginbtn" id="generic-oauth-login" href="/oauth/generic">Sign in with <strong>{{ .OauthGenericDisplayName }}</strong></a></div> <div class="row content-container signinbtns signinoauthbtns"><a class="btn cta loginbtn" id="generic-oauth-login" href="/oauth/generic">Sign in with <strong>{{ .OauthGenericDisplayName }}</strong></a></div>
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ else }} {{if not .DisablePasswordAuth}}
{{if .Flashes}}<ul class="errors"> {{if .Flashes}}<ul class="errors">
{{range .Flashes}}<li class="urgent">{{.}}</li>{{end}} {{range .Flashes}}<li class="urgent">{{.}}</li>{{end}}
</ul>{{end}} </ul>{{end}}

Loading…
Cancel
Save