File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,25 @@ class ::OmniAuth::Strategies::Oauth2Basic < ::OmniAuth::Strategies::OAuth2
32
32
result
33
33
end
34
34
end
35
+ # customization
36
+ def authorize_params
37
+ super . tap do |params |
38
+ params [ :appid ] = options . client_id
39
+ params [ :scope ] = 'snsapi_login'
40
+ params . delete ( 'client_id' )
41
+
42
+ end
43
+ end
44
+ def token_params
45
+ super . tap do |params |
46
+ params [ :appid ] = options . client_id
47
+ params [ :secret ] = options . client_secret
48
+ params [ :parse ] = :json
49
+ params . delete ( 'client_id' )
50
+ params . delete ( 'client_secret' )
51
+ end
52
+ end
53
+
35
54
36
55
def callback_url
37
56
Discourse . base_url_no_prefix + script_name + callback_path
@@ -258,6 +277,8 @@ def fetch_user_details(token, id)
258
277
end
259
278
260
279
def primary_email_verified? ( auth )
280
+ log ( "primary_email_verified: \n \n creds: #{ auth [ 'info' ] [ 'email_verified' ] } " )
281
+
261
282
return true if SiteSetting . oauth2_email_verified
262
283
verified = auth [ "info" ] [ "email_verified" ]
263
284
verified = true if verified == "true"
You can’t perform that action at this time.
0 commit comments