Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirmation email redirect to a certain host #37

Open
prp-e opened this issue Dec 29, 2023 · 0 comments
Open

Confirmation email redirect to a certain host #37

prp-e opened this issue Dec 29, 2023 · 0 comments

Comments

@prp-e
Copy link

prp-e commented Dec 29, 2023

Greetings.

I implemented devise's email confirmation on my app, which is an api only app and I also use devise-api in order to bring it to life.
The problem is when I confirm the account, it goes to localhost:3001/users/sing_in which is not there. I just want it to send my user back to the index page of my site. I am using this method:

class ConfirmationsController < Devise::ConfirmationsController

    def new
        super
      end
    
      def create
        super
      end
    
      def show
        self.resource = resource_class.confirm_by_token(params[:confirmation_token])
    
        if resource.errors.empty?
          set_flash_message(:notice, :confirmed) if is_navigational_format?
          sign_in(resource_name, resource)
          respond_with_navigational(resource){ redirect_to('https://example.com/page', allow_other_host: true) }
        else
          false
        end
      end

end

But as I said earlier, it goes to /users/sign_in to my app which does not exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant