got redirect for single sign on with uservoice working
This commit is contained in:
parent
d4c481aac0
commit
9a250d0034
2 changed files with 6 additions and 7 deletions
|
@ -10,8 +10,11 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
def after_sign_in_path_for(resource)
|
||||
sign_in_url = url_for(:action => 'new', :controller => 'sessions', :only_path => false, :protocol => 'http')
|
||||
|
||||
if request.referer == sign_in_url
|
||||
super
|
||||
elsif params[:uv_login] == "1"
|
||||
"https://support.metamaps.cc/login_success?sso=" + current_sso_token
|
||||
else
|
||||
stored_location_for(resource) || request.referer || root_path
|
||||
end
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
require 'uservoice-ruby'
|
||||
|
||||
def current_sso_token
|
||||
if ENV['SSO_KEY']
|
||||
@current_sso_token ||= UserVoice.generate_sso_token('metamapscc', ENV['SSO_KEY'], {
|
||||
:email => current_user.email
|
||||
}, 300) # Default expiry time is 5 minutes = 300 seconds
|
||||
else
|
||||
@current_sso_token = ''
|
||||
end
|
||||
@current_sso_token ||= UserVoice.generate_sso_token('metamapscc', ENV['SSO_KEY'], {
|
||||
:email => current_user.email
|
||||
}, 300) # Default expiry time is 5 minutes = 300 seconds
|
||||
end
|
Loading…
Reference in a new issue