You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to override Registrations so that i can have two seperate signup forms. I want to make use of two seperate login and register pages (one normal login/register and a seperate one for my checkout login/register). I am setting a session variable on the checkout/sign_in page.
Right now, if i try to sign in from my checkout/sign_in page and i have validation errors it pushes me back to the default devise sign_in page. Any help is appreciated
Routes
devise_for :users, path: 'account', controllers: { confirmations: 'confirmations', registrations: 'registrations'}
devise_scope :user do
patch "/confirm" => "confirmations#confirm"
end
My override controller. Notice the else if resource does not persist.
class RegistrationsController < Devise::RegistrationsController
def create
build_resource(sign_up_params)
resource.save
yield resource if block_given?
if resource.persisted?
if resource.active_for_authentication?
set_flash_message :notice, :signed_up if is_flashing_format?
sign_up(resource_name, resource)
respond_with resource, location: after_sign_up_path_for(resource)
else
set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_flashing_format?
expire_data_after_sign_in!
respond_with resource, location: after_inactive_sign_up_path_for(resource)
end
else
#IT SEEMS THIS DOES NOT WORK, EVEN IF I PASS IN THE PROPER LOGIN PATH PATH
respond_with resource, location: after_sign_up_path_for(resource)
end
end
private
def after_sign_up_path_for(resource)
session[:login_url] || root_url
end
end
The text was updated successfully, but these errors were encountered:
Please use the mailing list or StackOverflow for questions/help, where a wider community will be able to help you. We reserve the issues tracker for issues only.
I am trying to override Registrations so that i can have two seperate signup forms. I want to make use of two seperate login and register pages (one normal login/register and a seperate one for my checkout login/register). I am setting a session variable on the checkout/sign_in page.
Right now, if i try to sign in from my checkout/sign_in page and i have validation errors it pushes me back to the default devise sign_in page. Any help is appreciated
Routes
My override controller. Notice the else if resource does not persist.
The text was updated successfully, but these errors were encountered: