-
Notifications
You must be signed in to change notification settings - Fork 189
sign_in method for backend sign in #46
Comments
I'm reusing This action receives I also had to include |
For future visitors, here's a more up-to-date example using the ActiveRecord authenticator: class RegistrationsController < Devise::RegistrationsController
include CASino::SessionsHelper
private
def sign_up(resource_name, resource)
return unless params.has_key?(:service)
data = { authenticator: 'ActiveRecord', user_data: { username: resource.email }}
sign_in(data)
end
# Prevents render/redirect conflicts between Devise & CASino, also makes the
# service_with_ticket_url available for Devise to follow after registration.
def handle_signed_in_with_service(tgt, options)
if !service_allowed?(params[:service])
@service = params[:service]
render 'casino/sessions/service_not_allowed', status: 403
else
@url = acquire_service_ticket(tgt, params[:service], options).service_with_ticket_url
end
end
def after_sign_up_path_for(resource)
params.has_key?(:service) ? @url : super
end
end In order for this to work you'll need to ensure the Edit: Make sure you're only passing |
I want to sign in users with Casino after they successfully submit the sign up form.
Something like the Devise's sign_in method.
Thoughts?
The text was updated successfully, but these errors were encountered: