lib/auth_lh/authentication.rb in auth-lh-0.4.0 vs lib/auth_lh/authentication.rb in auth-lh-0.4.1

- old
+ new

@@ -27,11 +27,11 @@ def find_current_user(session_token, remote_ip, return_url=nil) response = AuthLh.get_current_user(session_token, remote_ip, return_url) logged_user = response.user - @login_url = response.login_url + @destination_url = response.destination_url if logged_user user = find_or_create_by(login: logged_user.login) user.auth_user = logged_user user @@ -39,10 +39,14 @@ nil end end def login_url(return_url=nil) - AuthLh.login_url(return_url) + if @destination_url.present? + @destination_url + else + AuthLh.login_url(return_url) + end end def logout_url(return_url=nil) AuthLh.logout_url(return_url) end