Home Programming Rails: Protect Devise when using OAuth

Rails: Protect Devise when using OAuth

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`.