Update application_controller to store client header in session

This commit is contained in:
Eugene Burmakin 2025-09-21 14:12:18 +02:00
parent 69cae258c9
commit c8d54f0ed6

View file

@ -3,12 +3,19 @@
module Auth module Auth
class IosController < ApplicationController class IosController < ApplicationController
def success def success
# If token is provided, this is the final callback for ASWebAuthenticationSession
if params[:token].present?
# ASWebAuthenticationSession will capture this URL and extract the token
render plain: "Authentication successful! You can close this window.", status: :ok
else
# This should not happen with our current flow, but keeping for safety
render json: { render json: {
success: true, success: true,
message: 'iOS authentication successful', message: 'iOS authentication successful',
token: params[:token],
redirect_url: root_url redirect_url: root_url
}, status: :ok }, status: :ok
end end
end end
end
end end