2025-09-21 06:46:59 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
module Auth
|
|
|
|
|
class IosController < ApplicationController
|
|
|
|
|
def success
|
2025-09-21 08:12:18 -04:00
|
|
|
# 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: {
|
|
|
|
|
success: true,
|
|
|
|
|
message: 'iOS authentication successful',
|
|
|
|
|
redirect_url: root_url
|
|
|
|
|
}, status: :ok
|
|
|
|
|
end
|
2025-09-21 06:46:59 -04:00
|
|
|
end
|
2025-09-21 08:12:18 -04:00
|
|
|
|
2025-09-21 06:46:59 -04:00
|
|
|
end
|
|
|
|
|
end
|