Filtered configured auth providers
This commit is contained in:
parent
6f379cc12c
commit
903dc45917
@ -33,8 +33,15 @@ type LoginModel struct {
|
||||
|
||||
// NewLoginModel constructor for LoginModel
|
||||
func (app *Bouquins) NewLoginModel(req *http.Request) *LoginModel {
|
||||
// TODO filter configured providers
|
||||
return &LoginModel{*app.NewModel("Authentification", "provider", req), Providers}
|
||||
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}
|
||||
}
|
||||
|
||||
// OAuth2Provider allows to get a user from an OAuth2 token
|
||||
|
Loading…
Reference in New Issue
Block a user