mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Update application_controller to store client header in session
This commit is contained in:
parent
69cae258c9
commit
c8d54f0ed6
1 changed files with 13 additions and 6 deletions
|
|
@ -3,12 +3,19 @@
|
||||||
module Auth
|
module Auth
|
||||||
class IosController < ApplicationController
|
class IosController < ApplicationController
|
||||||
def success
|
def success
|
||||||
render json: {
|
# If token is provided, this is the final callback for ASWebAuthenticationSession
|
||||||
success: true,
|
if params[:token].present?
|
||||||
message: 'iOS authentication successful',
|
# ASWebAuthenticationSession will capture this URL and extract the token
|
||||||
token: params[:token],
|
render plain: "Authentication successful! You can close this window.", status: :ok
|
||||||
redirect_url: root_url
|
else
|
||||||
}, status: :ok
|
# 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
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Loading…
Reference in a new issue