FIX: redirect to original URL after social login

This commit is contained in:
Régis Hanol
2018-01-26 18:52:27 +01:00
parent 3d595a52ca
commit e2d82b882e
3 changed files with 9 additions and 4 deletions

View File

@ -4,7 +4,7 @@ class Auth::Result
:awaiting_approval, :authenticated, :authenticator_name,
:requires_invite, :not_allowed_from_ip_address,
:admin_not_allowed_from_ip_address, :omit_username,
:skip_email_validation
:skip_email_validation, :destination_url
attr_accessor(
:failed,
@ -42,13 +42,15 @@ class Auth::Result
date: I18n.l(user.suspended_till, format: :date_only), reason: user.suspend_reason)
}
else
{
result = {
authenticated: !!authenticated,
awaiting_activation: !!awaiting_activation,
awaiting_approval: !!awaiting_approval,
not_allowed_from_ip_address: !!not_allowed_from_ip_address,
admin_not_allowed_from_ip_address: !!admin_not_allowed_from_ip_address
}
result[:destination_url] = destination_url if authenticated && destination_url.present?
result
end
else
result = { email: email,