File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,21 @@ def callback_url
46
46
options [ :redirect_uri ] || ( full_host + script_name + callback_path )
47
47
end
48
48
49
+ # from https://github.com/discourse/discourse-apple-auth/blob/486ce761aa44ba9b56056963b693644efc07a72f/lib/omniauth_apple.rb#L60
50
+ def callback_phase
51
+ if request . request_method . downcase . to_sym == :post
52
+ url = callback_url . dup
53
+ if ( code = request . params [ 'code' ] ) && ( state = request . params [ 'state' ] )
54
+ url += "?code=#{ CGI ::escape ( code ) } "
55
+ url += "&state=#{ CGI ::escape ( state ) } "
56
+ url += "&user=#{ CGI ::escape ( request . params [ 'user' ] ) } " if request . params [ 'user' ]
57
+ end
58
+ session . options [ :drop ] = true # Do not set a session cookie on this response
59
+ return redirect url
60
+ end
61
+ super
62
+ end
63
+
49
64
private
50
65
51
66
def new_nonce
You can’t perform that action at this time.
0 commit comments