Fix user creation failure handling in OAuth paths (#29207)
This commit is contained in:
		
					parent
					
						
							
								76a37bd040
							
						
					
				
			
			
				commit
				
					
						870ee80fd3
					
				
			
		
					 3 changed files with 7 additions and 1 deletions
				
			
		|  | @ -16,6 +16,9 @@ class Auth::OmniauthCallbacksController < Devise::OmniauthCallbacksController | |||
|         session["devise.#{provider}_data"] = request.env['omniauth.auth'] | ||||
|         redirect_to new_user_registration_url | ||||
|       end | ||||
|     rescue ActiveRecord::RecordInvalid | ||||
|       flash[:alert] = I18n.t('devise.failure.omniauth_user_creation_failure') if is_navigational_format? | ||||
|       redirect_to new_user_session_url | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue