File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,15 @@ def authorize_params
6969 end 
7070 end 
7171
72+  def  token_params 
73+  params  =  { } 
74+  options [ :passthrough_token_options ] . each  do  |k |
75+  val  =  session . delete ( "omniauth.param.#{ k }  ) 
76+  params [ k ]  =  val  unless  [ nil ,  '' ] . include? ( val ) 
77+  end 
78+  super . merge ( params ) 
79+  end 
80+ 
7281 uid  {  id_token_info [ 'sub' ]  } 
7382
7483 info  do 
@@ -140,15 +149,6 @@ def callback_url
140149 full_host  + script_name  + callback_path 
141150 end 
142151
143-  def  token_params 
144-  params  =  { } 
145-  options [ :passthrough_token_options ] . each  do  |k |
146-  val  =  session . delete ( "omniauth.param.#{ k }  ) 
147-  params [ k ]  =  val  unless  [ nil ,  '' ] . include? ( val ) 
148-  end 
149-  super . merge ( params ) 
150-  end 
151- 
152152 def  get_token_options 
153153 {  redirect_uri : callback_url , 
154154 grant_type : 'authorization_code' , 
Original file line number Diff line number Diff line change 101101 end 
102102 end 
103103
104+  describe  "token parameters"  do 
105+  it  "passes through parameters from authorize phase"  do 
106+  expect ( subject . authorize_params [ :p ] ) . to  eq ( "someallowedvalue" ) 
107+  allow ( subject ) . to  receive ( :request )  {  double ( "Request" ,  params : { } )  } 
108+  expect ( subject . token_params [ :p ] ) . to  eq ( "someallowedvalue" ) 
109+  end 
110+ 
111+  end 
112+ 
104113 end 
105114
106115end 
                         You can’t perform that action at this time. 
           
                  
0 commit comments