Pergunta

I am a newbie for RoR but I liked it so far. For the current project I already developed an authenticaion page where the user will be authenticated before and after login. I know that I will be doing more projects on RoR in the coming weeks as well and I don't want to copy paste my codes to enable authentication in my projects. How can I create an authentication system where I can use it in multiple projects. Are there any plugins already been developed?

You should also consider that, the authentication system also be on call (it should be listening everytime the user goes from one page to another page by checking if s/he is authorized and also the session haven't expired yet and so on.). That means I still need the authentication/authorization system to be there even after login. And how do I integrate it with other ruby projects I will be working on. I hope it makes sense.

The database where users will be authorized might be the same or different based on the projects.

Thank you

Foi útil?

Solução

Authentication/Authorization can be a tricky task. There are many pitfalls, so it would better to use a well tested gem until you're more familiar with it. Devise is a good option, but you can start learning about rolling your own authentication in the Rails Tutorial book if you're inclined.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top