File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,9 @@ func (s *Server) SetupRouter(r *gin.Engine) {
5050 webOauthServer .GET ("bind/account" , s .bindAccount )
5151 webOauthServer .GET ("bind/account/callback" , s .bindAccountCallback )
5252 webOauthServer .GET ("userinfo" , s .userInfoHandler )
53- webOauthServer .GET ("login" , s .webLoginHandler )
53+ webOauthServer .GET ("login" , s .webLoginHandler ) // web login entry point and redirect to custom service
5454 webOauthServer .GET ("login/callback" , s .webLoginCallbackHandler )
55- webOauthServer .GET ("login/callback/:service" , s .webLoginCallbackHandler )
55+ webOauthServer .GET ("login/callback/:service" , s .webLoginCallbackHandler ) // with service param, custom redirect
5656 webOauthServer .GET ("invite-code" , s .getUserInviteCodeHandler )
5757 }
5858 r .POST ("/oidc-auth/api/v1/send/sms" , s .SMSHandler )
Original file line number Diff line number Diff line change @@ -37,10 +37,13 @@ func (s *Server) webLoginHandler(c *gin.Context) {
3737
3838 // Use inviterCode as state parameter
3939 state := inviterCode
40- authURL := providerInstance . GetAuthURL ( state , s . BaseURL + constants . WebLoginCallbackURI )
40+ var redirectURL = ""
4141 if redirectService != "" {
42- authURL = fmt .Sprintf ("%s/%s" , authURL , redirectService )
42+ redirectURL = fmt .Sprintf ("%s/%s" , s .BaseURL + constants .WebLoginCallbackURI , redirectService )
43+ } else {
44+ redirectURL = s .BaseURL + constants .WebLoginCallbackURI
4345 }
46+ authURL := providerInstance .GetAuthURL (state , redirectURL )
4447 response .JSONSuccess (c , "" , map [string ]interface {}{
4548 "state" : state ,
4649 "inviter_code" : inviterCode ,
You can’t perform that action at this time.
0 commit comments