feature/auth_gitea #1

Manually merged
meutel merged 2 commits from feature/auth_gitea into master 2019-09-08 09:33:24 +00:00
Showing only changes of commit 903dc45917 - Show all commits

View File

@ -33,8 +33,15 @@ type LoginModel struct {
// NewLoginModel constructor for LoginModel // NewLoginModel constructor for LoginModel
func (app *Bouquins) NewLoginModel(req *http.Request) *LoginModel { func (app *Bouquins) NewLoginModel(req *http.Request) *LoginModel {
// TODO filter configured providers var configured []OAuth2Provider
return &LoginModel{*app.NewModel("Authentification", "provider", req), Providers} for _, p := range Providers {
for _, provConf := range app.Conf.ProvidersConf {
if provConf.Name == p.Name() {
configured = append(configured, p)
}
}
}
return &LoginModel{*app.NewModel("Authentification", "provider", req), configured}
} }
// OAuth2Provider allows to get a user from an OAuth2 token // OAuth2Provider allows to get a user from an OAuth2 token