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

Update FAQ method for using DeviseTokenAuth alongside Devise #1175

Merged
merged 3 commits into from
Jul 14, 2018
Merged

Update FAQ method for using DeviseTokenAuth alongside Devise #1175

merged 3 commits into from
Jul 14, 2018

Conversation

mrkrlli
Copy link
Contributor

@mrkrlli mrkrlli commented May 30, 2018

  • Several users have been experiencing problems using DeviseTokenAuth alongside Devise.

  • This new method example was given by jotolo, and it seems like a good approach to have in the FAQ docs. It's the most updated solution in this this thread on using Devise alongside DeviseTokenAuth: Having both devise and devise_token_auth #120 (comment)

@mrkrlli mrkrlli changed the title Update FAQ with another method for using DeviseTokenAuth alongside De… Update FAQ with new method for using DeviseTokenAuth alongside De… May 30, 2018
@mrkrlli mrkrlli changed the title Update FAQ with new method for using DeviseTokenAuth alongside De… Update FAQ method for using DeviseTokenAuth alongside Devise May 30, 2018
docs/faq.md Outdated

Some users have been experiencing issues with using this gem alongside standard Devise, with the `config.enable_standard_devise_support = true` method.

Another method suggested by [jotolo](https://github.com/jotolois) is to have separate child `application_controller.rb` files that use either DeviseTokenAuth or standard Devise, which all inherit from a base `application_controller.rb` file. For example, you could have an `api/v1/application_controller.rb` file for the API of your app (which would use Devise Token Auth), and a `admin/application_controller.rb` file for the full stack part of your app (using standard Devise). The idea is to redirect each flow in your application to the appropriate child `application_controller.rb` file. Example code below:
Copy link
Contributor

@jotolo jotolo May 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/jotolo is the right address ;) Thank you for the mention

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for catching that!

Copy link
Collaborator

@MaicolBen MaicolBen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the approach I would recommend, thanks. Do you have enable_standard_devise_support disabled?

@mrkrlli
Copy link
Contributor Author

mrkrlli commented Jun 4, 2018

@MaicolBen Yes, I have enable_standard_devise_support disabled. I left it commented out in the initializer:

  # By default, only Bearer Token authentication is implemented out of the box.
  # If, however, you wish to integrate with legacy Devise authentication, you can
  # do so by enabling this flag. NOTE: This feature is highly experimental!
  # config.enable_standard_devise_support = false

@MaicolBen MaicolBen merged commit 92d5083 into lynndylanhurley:master Jul 14, 2018
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

Successfully merging this pull request may close these issues.

3 participants