Ask A Question

Notifications

You’re not receiving notifications from this thread.

User Authentication with Devise | GoRails

Chris Oliver asked in General

This was a good video. Thank you. I am currently implementing Devise with a Rails JSON API but this gave me a good foundation.

Reply

@N8Guard I'm in the same situation. Are you able to share any info on how you implemented it?
Thanks!

Reply
Anthony Candaele Anthony Candaele

Good video. Are there scenarios where you would roll out your own authentication system instead of using Devise?

Reply

Plenty of cases, but most of those revolve around building out a very custom onboarding flow. Most of the time (including OAuth) is handled well enough with Devise.

Reply

Excelente muchas gracias por el video :)

Reply

This was an excellent episode Chris!

Reply

If you are intending to use an authorisation gem such as cancancan or pundit then the the other videos use 'rails generate devise User role'. Save you a couple of clicks going back to see.

Reply

What video did you create the navbar partial?

Reply
Reply

The form-group class that is added doesn't render my form as Bootstrap at all :( hmm

Reply

Here is a link to the forum post where I shared links to my Gist code to Bootstrap the Devise views.

https://gorails.com/forum/b...

Reply
icsvortex666 icsvortex666

Hey Chris, I saw an old post from your blog about devise session sharing between subdomains (different apps?), do you know how to achieve this with rails 4?
Thanks :)

Reply

If you're authenticating between different apps, then you want them to share the same secret key. The cookie_store is signed with that key (I believe) so you would simply want to modify both apps to use the same SECRET_TOKEN in your application.yml files in production. That should do the trick (along with setting the domain on the cookies in the other post you mentioned).

Reply

Great video. I have a question about 'correct users'. Let's say the user who submitted the book could also edit their submission. However we would only want this user to edit it and not other users. Does devise have a way to handle correct users - or would we need to create our own?

Reply

They way you could solve the authorization problem is by updating your Edit/Update/Destroy actions to use current_user.books.find() instead of Book.find(). That will scope it to only the ones that user owns so they cannot edit other user's books.

Reply
Vishal Deepak Vishal Deepak

can you instruct me if I need to create two devise models . Basically in my app there are 2 users. One are typical users that ask questions and the other are expert users that answer the questions posted by the typical users. The expert users account can only be created with approval from developers/admin? I posted a question on stackoverflow -http://stackoverflow.com/qu...

Reply

Awesome video. Very clear and easy to follow. Thanks much!

Reply

Thanks! :)

Reply

am trying to set up a simple blog with devise.How can i restrict users from editing the profiles of other users. so mush so that if the try something users/edit.3, there will be redirected to somewhere with flash message. Thanks

Reply

Hi,
I have used Devise for authentication and it worked fine with one devise User model.
Now, I have 2 to 3 User models using 2 or 3 separate Devise functionalities.
I have having a problem with the update functionality of the second Devise. The original first one works well, but for the second one, I get this error when I click on "update" after updating the user's profile parameters:
The action 'update' could not be found for User2Controller

What does that normally mean?

Reply

Hi Chris. Any indications/directions on how to turn the edit profile into a modal like on gorails website? Best

Reply

Nothing too special, just toss them in a Bootstrap modal and that's it. :)

Reply

It would been great if we could know how the alert message gets auto removed from the screen?

Reply
thisiswhy1called thisiswhy1called

simple procedure attempts!

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.