Adds generic oAuth bool & name string to login view.
Signed-off-by: prichier <pascoualito@gmail.com>
This commit is contained in:
parent
99d86a7489
commit
6174987c6a
22
account.go
22
account.go
|
@ -66,7 +66,7 @@ func NewUserPage(app *App, r *http.Request, u *User, title string, flashes []str
|
|||
}
|
||||
|
||||
func canUserInvite(cfg *config.Config, isAdmin bool) bool {
|
||||
return cfg.App.UserInvites != "" &&
|
||||
return cfg.App.UserInvites != "" &&
|
||||
(isAdmin || cfg.App.UserInvites != "admin")
|
||||
}
|
||||
|
||||
|
@ -299,14 +299,16 @@ func viewLogin(app *App, w http.ResponseWriter, r *http.Request) error {
|
|||
|
||||
p := &struct {
|
||||
page.StaticPage
|
||||
To string
|
||||
Message template.HTML
|
||||
Flashes []template.HTML
|
||||
LoginUsername string
|
||||
OauthSlack bool
|
||||
OauthWriteAs bool
|
||||
OauthGitlab bool
|
||||
GitlabDisplayName string
|
||||
To string
|
||||
Message template.HTML
|
||||
Flashes []template.HTML
|
||||
LoginUsername string
|
||||
OauthSlack bool
|
||||
OauthWriteAs bool
|
||||
OauthGitlab bool
|
||||
OauthGeneric bool
|
||||
OauthGenericDisplayName string
|
||||
GitlabDisplayName string
|
||||
}{
|
||||
pageForReq(app, r),
|
||||
r.FormValue("to"),
|
||||
|
@ -316,6 +318,8 @@ func viewLogin(app *App, w http.ResponseWriter, r *http.Request) error {
|
|||
app.Config().SlackOauth.ClientID != "",
|
||||
app.Config().WriteAsOauth.ClientID != "",
|
||||
app.Config().GitlabOauth.ClientID != "",
|
||||
app.Config().GenericOauth.ClientID != "",
|
||||
config.OrDefaultString(app.Config().GenericOauth.DisplayName, oAuthGenericDisplayName),
|
||||
config.OrDefaultString(app.Config().GitlabOauth.DisplayName, gitlabDisplayName),
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue