mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
added hosted domain suppport to google oauth login (#6372)
This commit is contained in:
committed by
Torkel Ödegaard
parent
7acdbde8f0
commit
658fc1a67a
@@ -53,7 +53,11 @@ func OAuthLogin(ctx *middleware.Context) {
|
||||
if code == "" {
|
||||
state := GenStateString()
|
||||
ctx.Session.Set(middleware.SESS_KEY_OAUTH_STATE, state)
|
||||
ctx.Redirect(connect.AuthCodeURL(state, oauth2.AccessTypeOnline))
|
||||
if setting.OAuthService.OAuthInfos[name].HostedDomain == "" {
|
||||
ctx.Redirect(connect.AuthCodeURL(state, oauth2.AccessTypeOnline))
|
||||
}else{
|
||||
ctx.Redirect(connect.AuthCodeURL(state, oauth2.SetParam("hd", setting.OAuthService.OAuthInfos[name].HostedDomain), oauth2.AccessTypeOnline));
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user