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

No create in confirmations controller? #1093

Closed
davidwparker opened this issue Feb 17, 2018 · 3 comments
Closed

No create in confirmations controller? #1093

davidwparker opened this issue Feb 17, 2018 · 3 comments

Comments

@davidwparker
Copy link

I noticed in the confirmations controller that there is no create action.

I'm using rails-api, and the plan is to have a 100% React frontend. As Rails won't be handling any views, I don't expect devise_token_auth to handle confirmations w/a handler, but instead I would handle it via React.

Is the best way to handle this to override the default confirmations controller? Or is there a plan to make a create action so the gem can handle it?

Thanks!

@zachfeldman
Copy link
Contributor

Hey @davidwparker , can you be more specific? My understanding is that a confirmation just sends a token back to the server, we confirm the user, then send back an auth token for you to user for to keep them logged in after that. The show action handles this, so why do you need a create? If you need to send the user an email, you could just generate a token for them using Devise's built in methods and then send them an email yourself (that's what we do).

I suppose it might be nice to integrate this directly into the lib as a controller action though! Feel free to write a PR.

@davidwparker
Copy link
Author

davidwparker commented Feb 18, 2018

@zachfeldman - when the user hits the application from the email, it will never hit the show method, as for my app it's all an SPA and each request doesn't hit the backend unless I manually send that extra request. For this instance, I figured it would just create the confirmation manually (similar to how the show works) but just render the resource as json.

I decided to just manually override this controller. It may be nice to add as you say, but I don't think it's that important and it's pretty easy to override.

Thanks!

@zachfeldman
Copy link
Contributor

Ok!

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

2 participants