Compare commits

..

2 Commits

Author SHA1 Message Date
6999c11d50 Configure gitea oauth2 2019-09-08 11:23:22 +02:00
063abcf9d1 WIP: auth gitea 2019-09-08 10:41:10 +02:00

View File

@ -33,15 +33,8 @@ type LoginModel struct {
// NewLoginModel constructor for LoginModel
func (app *Bouquins) NewLoginModel(req *http.Request) *LoginModel {
var configured []OAuth2Provider
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}
// TODO filter configured providers
return &LoginModel{*app.NewModel("Authentification", "provider", req), Providers}
}
// OAuth2Provider allows to get a user from an OAuth2 token