devise

Rails register User using phone number and confirmation

可紊 提交于 2020-01-05 07:43:29
问题 I am building an iPhone app and the rails backend for it. I want the user to register via their phone number and a confirmation code sent using SMS. It should work like WhatsApps authentication. Does anyone know a gem, ideally for devise, or do I have to build this on my own? 来源: https://stackoverflow.com/questions/17771856/rails-register-user-using-phone-number-and-confirmation

failing migrations : PG::ProtocolViolation Rails

本秂侑毒 提交于 2020-01-05 07:29:09
问题 I just updated to rails4 and realized that my db roles and database was somehow not setup. So I dropped the db and re-created the app_development db and the roles. Now I am trying to run rake db:migrate and its failing with following error: == DeviseCreateUsers: migrating ============================================== -- create_table(:users) -> 0.0081s -- add_index(:users, :email, {:unique=>true}) -> 0.0031s -- add_index(:users, :reset_password_token, {:unique=>true}) -> 0.0030s ==

Heroku [WARNING] You provided devise_for :users but there is no model User defined in your application

僤鯓⒐⒋嵵緔 提交于 2020-01-05 07:26:09
问题 I have an rails 3 (3.0.9) application working on ruby 1.8.7 with the gem devise (1.4.2) on my computer working perfectly. I tried to push it on heroku and i got the following error message on application load: [WARNING] You provided devise_for :users but there is no model User defined in your application => Booting WEBrick => Rails 3.0.9 application starting in production on http://0.0.0.0:43292 => Call with -d to detach => Ctrl-C to shutdown server Exiting /app/vendor/bundle/ruby/1.9.1/gems

Log incident when an account is locked after three failed attempts with Devise

社会主义新天地 提交于 2020-01-05 06:51:12
问题 I want to log in the database the incident when a users account is locked, I'm using Rails3 and Devise, so I think I'll need to override some action in a Devise controller, I just don't know wich controller/action and how to capture the users Id. Any tips? 回答1: I know this is an old question, but the easiest approach is probably to override lock_access! from the lockable mixin (in your user model): def lock_access! super # record an account lock here end 来源: https://stackoverflow.com

How do I solve this Devise authentication challenge?

走远了吗. 提交于 2020-01-05 06:14:08
问题 Hello people I have some challenges here with devise authentication for users: I have two models called color and sub_color in my application. the sub_color belongs_to color and color has_many sub_colors.I have already seeded the database with the appropriate data The challenge; I want a user to be able to chose these in the devise form_for when they are registering as a collection object and the id of the sub_color will be used for identifying a particular user also(a situation where for

Devise, no E-Mails

霸气de小男生 提交于 2020-01-05 04:32:28
问题 I installed devise. I run rails server -e development and set this line in config/environments: config.action_mailer.default_url_options = {:host => 'localhost:3000'} Devises says: message with a confirmation link has been sent to your email address. Please open the link to activate your account. But I didn't receive any mail. What do you think? 回答1: Add these lines to your development.rb file config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address =>

Find_for_database_authentication vs Find_by in Rails Devise app?

拈花ヽ惹草 提交于 2020-01-05 04:06:24
问题 So, I'm trying to set up a React frontend and Rails backend with devise, and the Rails side is supposed to be an internal API. It's the first time I've ever done this, so I'm struggling with authentication. Specifically, in my SessionsController, I have this code: def create resource = User.find_for_database_authentication(email: params[:email]) return invalid_login_attempt unless resource if resource.valid_password?(params[:password]) sign_in :user, resource return render nothing: true end

Find_for_database_authentication vs Find_by in Rails Devise app?

走远了吗. 提交于 2020-01-05 04:06:06
问题 So, I'm trying to set up a React frontend and Rails backend with devise, and the Rails side is supposed to be an internal API. It's the first time I've ever done this, so I'm struggling with authentication. Specifically, in my SessionsController, I have this code: def create resource = User.find_for_database_authentication(email: params[:email]) return invalid_login_attempt unless resource if resource.valid_password?(params[:password]) sign_in :user, resource return render nothing: true end

How to set devise mails sender name?

浪尽此生 提交于 2020-01-04 06:32:13
问题 I am using rails devise gem. Devise sends cofirmation email to new users. Actionmailer is configured to use my gmail account to send emails. The email is sent by sender: "no-reply@myapp.com" which is my actionmailer global username configuration. I want to set sender to include my name " Mahmoud Khaled no-reply@myapp.com" And for sure I can't update actionmailer username configration to include name because it should be only GMAIL username. Any help how can i set devise from parameter? 回答1:

Custom devise api token auth

梦想与她 提交于 2020-01-04 05:54:33
问题 What is the best way to find a registered user with token authentication? The way I currently do it is to query the db for the token the app sends to access the api. E.g. 'user = User.where(:authentication_token => params[:authtoken]).first '. Is this safe? I have seen code that uses warden.authenticate and another that does the ff: the client sends the email along with the authtoken. It then uses the email to find the user and then does a devise secure compare with the sent token and the