devise-confirmable

How to send two different emails for devise confirmable and devise reconfirmable?

…衆ロ難τιáo~ 提交于 2021-02-19 01:34:53
问题 Both devise confirmable (email confirmation when user signs up) and reconfirmable (email confirmation when user changes email) modules send the same email template, "confirmation_instructions". How do I get it so that a different email template is used for confirmable? 回答1: You can override options[:template_name] in the #confirmation_instructions method of your mailer. class AuthMailer < Devise::Mailer helper :application include Devise::Controllers::UrlHelpers default template_path: 'devise

Devise Confirmation invalid on first send

我是研究僧i 提交于 2020-01-23 01:47:47
问题 I have a Rails 4 app with Devise 3.2.2 using :confirmable , and am running into an issue with it sending invalid confirmation tokens, but only the first time . After you resend the confirmation token, the link works. The relevant routes: devise_for :users, skip: [:sessions, :passwords, :confirmations, :unlocks, :registrations, :invitations] as :user do ... # joining get '/register' => 'devise/registrations#new', as: 'new_user_registration' post '/register' => 'devise/registrations#create', as

How do I add instance variables to Devise email templates?

雨燕双飞 提交于 2019-12-23 09:28:03
问题 I am trying to edit the confirmation_instructions.html.erb file to address the new user by first name instead of email. Current the beginning of the file reads... Hi, <%= @email %>, How do I add an instance variable @first_name to the controller/mailer? I ran rails generate devise:controllers users, but I just don't see any .rb files where I could add instance variables to confirmation mailer (if there is one) Thanks 回答1: This is easy, you can just create a Mailer for this: class

Remove password confirmation; devise

落爺英雄遲暮 提交于 2019-12-23 07:39:20
问题 I am using devise for authentication in my Rails 3.2.6 app. I had password confirmation first but now I want to remove it. How to go about that? 回答1: You just need to remove the password_confirmation field from your form. More info in this answer. 来源: https://stackoverflow.com/questions/11641901/remove-password-confirmation-devise

Rails 3 Devise confirmation filter

↘锁芯ラ 提交于 2019-12-23 03:31:55
问题 I'm wondering if it's possible to selectively require confirmation for certain controller actions using Devise. Basically: I want users to sign up for an account (which will trigger a confirmation email), be automatically logged in, and be able to immediately explore certain parts of the site as a signed in (but still unconfirmed) user. Access to certain areas (e.g., payment) would require the user to first confirm their email . I'm hoping for something like before_filter: user_is_confirmed,

Avoid sign-in after confirmation link click using devise gem?

百般思念 提交于 2019-12-17 15:39:51
问题 I am using devise gem, after clicking on the confirmation link, I want to directly sign-in. At present it is asking to sign-in again. Recently I have added the following in the devise initialize file: config.allow_insecure_token_lookup = true config.secret_key = 'a8d814803c0bcc735ce657adc77793459d00154cdd7532c13d3489600dc4e963f86e14beb593a32cbe9dbbe9197c9ce50a30102f363d90350052dc8d69930033' Any suggestions? 回答1: In previous Devise versions, the user was automatically signed in after

Avoid sign-in after confirmation link click using devise gem?

核能气质少年 提交于 2019-12-17 15:39:45
问题 I am using devise gem, after clicking on the confirmation link, I want to directly sign-in. At present it is asking to sign-in again. Recently I have added the following in the devise initialize file: config.allow_insecure_token_lookup = true config.secret_key = 'a8d814803c0bcc735ce657adc77793459d00154cdd7532c13d3489600dc4e963f86e14beb593a32cbe9dbbe9197c9ce50a30102f363d90350052dc8d69930033' Any suggestions? 回答1: In previous Devise versions, the user was automatically signed in after

Devise confirmable: Token is invalid error

我们两清 提交于 2019-12-13 06:59:27
问题 Been looking for past 3 hours... setting up confirmable email it protrayed as being easy but its is FAR from that. Anyway, I have fought through slew of errors and undefined maethods and variables and have wrestled this thing to send me something... However I cannot confirm it. I have looked under the hood in the confirmations controller to no avail... It just does not confirm right. I dont know what I am doing wrong here but it consistently redirects me to "Resend confirmation instructions"

Devise - Skipping user confirmation in Development

南笙酒味 提交于 2019-12-12 15:11:49
问题 How do you skip user confirmation in development in devise. I have set up the production environment to send emails with SendGrid, but now I have done that it won't let me log in. Thanks for your time! 回答1: create User in console: user = User.create( :first_name => 'admin', :last_name => 'admin', :email => 'foo...@email.com', :password => 'password1', :password_confirmation => 'password1' ).skip_confirmation! # Devise :doc: # If you don't want confirmation to be sent on create, neither a code

Skip email confirmation when creating a new user using Devise

泪湿孤枕 提交于 2019-12-12 10:38:06
问题 I have a user registration page and will send the information to couple of admin users that one new user registered in the site. Now, I created the seed data with list of users (200+). So, It'll send the 200+ email to the respective admin users. Hence, I want to stop send the mail confirmation to admin users when creating new user. 回答1: For Devise, add user.skip_confirmation! before saving. user = User.new( :email => 'person@example.com', :password => 'password1', :password_confirmation =>