pull/624/head
hydarakb 3 months ago
parent feb60d1473
commit 048d075160

@ -10,6 +10,7 @@ class SsoLoginController < ApplicationController
def login
token = params[:token]
template_id = params[:template_id]
unless token.present?
return redirect_to root_path, alert: 'Missing authentication token'
@ -41,6 +42,11 @@ class SsoLoginController < ApplicationController
# Sign in the user
sign_in(user)
# Redirect to template preview if template_id is present
if template_id.present?
return redirect_to controller: 'templates', action: 'preview', id: template_id
end
# Redirect to dashboard
redirect_to root_path, notice: 'Signed in successfully'
else
@ -234,4 +240,3 @@ class SsoLoginController < ApplicationController
end
end
end
Loading…
Cancel
Save