mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 03:27:52 +00:00
chore: hard coded url
This commit is contained in:
@@ -16,7 +16,10 @@ class DeviseOverrides::OmniauthCallbacksController < DeviseTokenAuth::OmniauthCa
|
|||||||
# we can just send them to the login page again with the SSO params
|
# we can just send them to the login page again with the SSO params
|
||||||
# that will log them in
|
# that will log them in
|
||||||
encoded_email = ERB::Util.url_encode(@resource.email)
|
encoded_email = ERB::Util.url_encode(@resource.email)
|
||||||
redirect_to login_page_url(email: encoded_email, sso_auth_token: @resource.generate_sso_auth_token)
|
redirect_url = login_page_url(email: encoded_email, sso_auth_token: @resource.generate_sso_auth_token)
|
||||||
|
|
||||||
|
# Allow redirect to mobile app custom scheme
|
||||||
|
redirect_to redirect_url, allow_other_host: true
|
||||||
end
|
end
|
||||||
|
|
||||||
def sign_up_user
|
def sign_up_user
|
||||||
@@ -30,11 +33,14 @@ class DeviseOverrides::OmniauthCallbacksController < DeviseTokenAuth::OmniauthCa
|
|||||||
end
|
end
|
||||||
|
|
||||||
def login_page_url(error: nil, email: nil, sso_auth_token: nil)
|
def login_page_url(error: nil, email: nil, sso_auth_token: nil)
|
||||||
frontend_url = ENV.fetch('FRONTEND_URL', nil)
|
# Hardcoded mobile redirect URL for testing
|
||||||
params = { email: email, sso_auth_token: sso_auth_token }.compact
|
params = {}
|
||||||
|
params[:email] = email if email.present?
|
||||||
|
params[:sso_auth_token] = sso_auth_token if sso_auth_token.present?
|
||||||
params[:error] = error if error.present?
|
params[:error] = error if error.present?
|
||||||
|
|
||||||
"#{frontend_url}/app/login?#{params.to_query}"
|
query_string = params.map { |k, v| "#{k}=#{ERB::Util.url_encode(v.to_s)}" }.join('&')
|
||||||
|
"chatwootapp://sso/callback?#{query_string}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def account_signup_allowed?
|
def account_signup_allowed?
|
||||||
|
|||||||
Reference in New Issue
Block a user