Home Programming Rails: Protect Devise when using OAuth

Rails: Protect Devise when using OAuth

0
158
Pixabay at Pexels

If you’re using OAuth and Devise together in an application, you need to remove the Devise Authentication routes and still confirm your model won’t go nuts creating rogue users. 

With this snippet, you can prevent users from getting to those authentication routes and still prevent those rogue users from entering your system. 

We are assuming that the user model has a boolean value which can be set to `:approved_user`.

https://gist.github.com/thehashrocket/574d55ca183f19a5dbfcb7da3dc72f00.js