Z
Z
Zaur Ashurbekov2014-04-28 13:27:38
Ruby on Rails
Zaur Ashurbekov, 2014-04-28 13:27:38

Login to the admin panel. How to build an authentication system correctly? Rails

Hello Habr!
Actually the question is this: there is an admin panel, of course, only the admin should enter there, and of course, there is only one admin. The question is how to remember the login password. Create a table in the database for one record? Or just register in the controller or in the model? If you register in the model or in the controller, how safe is it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arkady Butermanov, 2014-04-28
@zaurius

Store in some config (config/secrets.yml for example) salt and hashed password. During login, hash the entered password with the salt from the config and compare with the value from the config.
In general, I see nothing wrong with using https://github.com/plataformatec/devise with the only included module: database_authenticatable.

E
Eugene Burmakin, 2014-04-28
@Freika

In pursuit: ActiveAdmin and CanCan gems

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question