0

I am using devise for authentication and i use rails as backend for ios application. I wanted to save the user attributes and it does not have password field in the registration, so i overrided the devise registration controller and made it as required.

Now i wanted to allow the user to be authenticated on the every request, so usually i use "authenticate_user!" method in other controllers so it would check the user on every request but it requires password to do so but in my case i now do not have password, so how can i verify the user on every request.

Can i able to override the authenticate_user! method and allow to check email and type(for example) instead of email and password or tell me if there is some other way.

Also please tell me how devise access the authorization header and use it in the authenticate_user! method. Please help me. I am stuck with this for quiet a long time.

4

1 回答 1

1

正如我之前回答的那样,您可以覆盖模型中find_first_by_auth_conditions的方法User。请看我之前的回答。

Rails Gem Devise 是否有允许用户拥有多封电子邮件的解决方案?

于 2013-08-29T05:38:13.100 回答