Add force_login option to OAuth authorize page (#8655)
* Add force_login option to OAuth authorize page For when a user needs to sign into an app from multiple accounts on the same server * When logging out from modal header, redirect back after re-login
This commit is contained in:
		
							parent
							
								
									2492c12281
								
							
						
					
					
						commit
						2288d50a7b
					
				
					 7 changed files with 62 additions and 9 deletions
				
			
		|  | @ -28,8 +28,10 @@ class Auth::SessionsController < Devise::SessionsController | |||
|   end | ||||
| 
 | ||||
|   def destroy | ||||
|     tmp_stored_location = stored_location_for(:user) | ||||
|     super | ||||
|     flash.delete(:notice) | ||||
|     store_location_for(:user, tmp_stored_location) if continue_after? | ||||
|   end | ||||
| 
 | ||||
|   protected | ||||
|  | @ -124,8 +126,14 @@ class Auth::SessionsController < Devise::SessionsController | |||
|   end | ||||
| 
 | ||||
|   def clear_site_data | ||||
|     return if continue_after? | ||||
| 
 | ||||
|     # Should be '"*"' but that doen't work in Chrome (neither does '"executionContexts"') | ||||
|     # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Clear-Site-Data | ||||
|     response.headers['Clear-Site-Data'] = '"cache", "cookies", "storage"' | ||||
|   end | ||||
| 
 | ||||
|   def continue_after? | ||||
|     truthy_param?(:continue) | ||||
|   end | ||||
| end | ||||
|  |  | |||
		Reference in a new issue