Search code examples
rubyauthenticationpadrino

Padrino basic user authentication


I was wondering if anyone can shed some light on setting up basic user authentication. I've installed the admin app into my project and it works great. But I need a basic user role that can have it's own registration page etc.

I need to see something like

domain.com/users/user.slug

would take them to their profile page

I'm also going to have nested resources, so a user can have a project associated to them.

domain.com/users/user.slug/projects/project.slug or domain.com/users/user.slug/project.slug

The admin piece worked great, but I have no idea how to setup registration etc for a user model?

I've used devise in the past with Rails and I'm wondering if anything like it currently exists? I've seen some discussion around warden. Is there a defacto solution that people are using or am I able to implement the admin app to handle this? Right now /accounts is protected and can only be accessed by the admin role.. so I can't have users go to accounts/new

Thanks


Solution

  • For now I basically just copied the admin app.. into my own Users app while using my own User model.

    The user model is basically a direct port of the account model.. as is the session controller etc. Just switched the model names around.

    I'm still not sure if this is the best approach or if I'm able to leverage the admin app to handle this also?

    This solution is working, though again, I'm not sure if it's the optimal approach.