@@ -100,13 +100,13 @@ func OAuthLoginHandler() gin.HandlerFunc {
100100 provider := c .Param ("oauth_provider" )
101101 isProviderConfigured := true
102102 switch provider {
103- case constants .SignupMethodGoogle :
103+ case constants .AuthRecipeMethodGoogle :
104104 if oauth .OAuthProviders .GoogleConfig == nil {
105105 log .Debug ("Google OAuth provider is not configured" )
106106 isProviderConfigured = false
107107 break
108108 }
109- err := memorystore .Provider .SetState (oauthStateString , constants .SignupMethodGoogle )
109+ err := memorystore .Provider .SetState (oauthStateString , constants .AuthRecipeMethodGoogle )
110110 if err != nil {
111111 log .Debug ("Error setting state: " , err )
112112 c .JSON (500 , gin.H {
@@ -115,75 +115,75 @@ func OAuthLoginHandler() gin.HandlerFunc {
115115 return
116116 }
117117 // during the init of OAuthProvider authorizer url might be empty
118- oauth .OAuthProviders .GoogleConfig .RedirectURL = hostname + "/oauth_callback/" + constants .SignupMethodGoogle
118+ oauth .OAuthProviders .GoogleConfig .RedirectURL = hostname + "/oauth_callback/" + constants .AuthRecipeMethodGoogle
119119 url := oauth .OAuthProviders .GoogleConfig .AuthCodeURL (oauthStateString )
120120 c .Redirect (http .StatusTemporaryRedirect , url )
121- case constants .SignupMethodGithub :
121+ case constants .AuthRecipeMethodGithub :
122122 if oauth .OAuthProviders .GithubConfig == nil {
123123 log .Debug ("Github OAuth provider is not configured" )
124124 isProviderConfigured = false
125125 break
126126 }
127- err := memorystore .Provider .SetState (oauthStateString , constants .SignupMethodGithub )
127+ err := memorystore .Provider .SetState (oauthStateString , constants .AuthRecipeMethodGithub )
128128 if err != nil {
129129 log .Debug ("Error setting state: " , err )
130130 c .JSON (500 , gin.H {
131131 "error" : "internal server error" ,
132132 })
133133 return
134134 }
135- oauth .OAuthProviders .GithubConfig .RedirectURL = hostname + "/oauth_callback/" + constants .SignupMethodGithub
135+ oauth .OAuthProviders .GithubConfig .RedirectURL = hostname + "/oauth_callback/" + constants .AuthRecipeMethodGithub
136136 url := oauth .OAuthProviders .GithubConfig .AuthCodeURL (oauthStateString )
137137 c .Redirect (http .StatusTemporaryRedirect , url )
138- case constants .SignupMethodFacebook :
138+ case constants .AuthRecipeMethodFacebook :
139139 if oauth .OAuthProviders .FacebookConfig == nil {
140140 log .Debug ("Facebook OAuth provider is not configured" )
141141 isProviderConfigured = false
142142 break
143143 }
144- err := memorystore .Provider .SetState (oauthStateString , constants .SignupMethodFacebook )
144+ err := memorystore .Provider .SetState (oauthStateString , constants .AuthRecipeMethodFacebook )
145145 if err != nil {
146146 log .Debug ("Error setting state: " , err )
147147 c .JSON (500 , gin.H {
148148 "error" : "internal server error" ,
149149 })
150150 return
151151 }
152- oauth .OAuthProviders .FacebookConfig .RedirectURL = hostname + "/oauth_callback/" + constants .SignupMethodFacebook
152+ oauth .OAuthProviders .FacebookConfig .RedirectURL = hostname + "/oauth_callback/" + constants .AuthRecipeMethodFacebook
153153 url := oauth .OAuthProviders .FacebookConfig .AuthCodeURL (oauthStateString )
154154 c .Redirect (http .StatusTemporaryRedirect , url )
155- case constants .SignupMethodLinkedIn :
155+ case constants .AuthRecipeMethodLinkedIn :
156156 if oauth .OAuthProviders .LinkedInConfig == nil {
157157 log .Debug ("Linkedin OAuth provider is not configured" )
158158 isProviderConfigured = false
159159 break
160160 }
161- err := memorystore .Provider .SetState (oauthStateString , constants .SignupMethodLinkedIn )
161+ err := memorystore .Provider .SetState (oauthStateString , constants .AuthRecipeMethodLinkedIn )
162162 if err != nil {
163163 log .Debug ("Error setting state: " , err )
164164 c .JSON (500 , gin.H {
165165 "error" : "internal server error" ,
166166 })
167167 return
168168 }
169- oauth .OAuthProviders .LinkedInConfig .RedirectURL = hostname + "/oauth_callback/" + constants .SignupMethodLinkedIn
169+ oauth .OAuthProviders .LinkedInConfig .RedirectURL = hostname + "/oauth_callback/" + constants .AuthRecipeMethodLinkedIn
170170 url := oauth .OAuthProviders .LinkedInConfig .AuthCodeURL (oauthStateString )
171171 c .Redirect (http .StatusTemporaryRedirect , url )
172- case constants .SignupMethodApple :
172+ case constants .AuthRecipeMethodApple :
173173 if oauth .OAuthProviders .AppleConfig == nil {
174174 log .Debug ("Apple OAuth provider is not configured" )
175175 isProviderConfigured = false
176176 break
177177 }
178- err := memorystore .Provider .SetState (oauthStateString , constants .SignupMethodApple )
178+ err := memorystore .Provider .SetState (oauthStateString , constants .AuthRecipeMethodApple )
179179 if err != nil {
180180 log .Debug ("Error setting state: " , err )
181181 c .JSON (500 , gin.H {
182182 "error" : "internal server error" ,
183183 })
184184 return
185185 }
186- oauth .OAuthProviders .AppleConfig .RedirectURL = hostname + "/oauth_callback/" + constants .SignupMethodApple
186+ oauth .OAuthProviders .AppleConfig .RedirectURL = hostname + "/oauth_callback/" + constants .AuthRecipeMethodApple
187187 // there is scope encoding issue with oauth2 and how apple expects, hence added scope manually
188188 // check: https://github.com/golang/oauth2/issues/449
189189 url := oauth .OAuthProviders .AppleConfig .AuthCodeURL (oauthStateString , oauth2 .SetAuthURLParam ("response_mode" , "form_post" )) + "&scope=name email"
0 commit comments