devise

Rails 4 + Devise 3.0 - Authenticate using username and email

徘徊边缘 提交于 2020-01-16 01:00:35
问题 I'm trying to allow users to sign in with either their username or their email address. as per here: https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-using-their-username-or-email-address When ever I try to sign in with either the email or the login this is logged: Started POST "/users/sign_in" for 192.168.2.8 at 2013-11-22 10:11:50 +0800 Processing by Devise::SessionsController#create as HTML Parameters: {"utf8"=>"â", "authenticity_token"=>

redirect_url is missing in email instructions sent to the user for password reset

戏子无情 提交于 2020-01-15 23:57:10
问题 I am trying to build api urls for password reset via. devise_token_auth gem. As per the usage mentioned here, the POST request for /api/v1/auth/password needs params email and redirect_url . The user matching the email param will be sent instructions on how to reset their password. redirect_url is the url to which the user will be redirected after visiting the link contained in the email. However, I am getting the following URL in the email for password reset, in which the param redirect_url

How to create a test user in test/fixtures/user.yml that can be used for integration test in Devise 4?

别来无恙 提交于 2020-01-15 05:18:27
问题 As you can see from the codes below, I already created a user in users.yml , included the devise's helper for integration test in test_helper.rb (that's why I was able to use the sign_in method - based on Devise's README), and have a passing integration test in site_layout_test.rb . My question is, when I tried to comment-out the email , encrypted_password , and created_at params of user john in users.yml , I still have a passing test but my newbie mind tells me that I should have a failing

Using Devise to auto login a user on a multi tenancy site with subdomains

▼魔方 西西 提交于 2020-01-15 04:54:09
问题 In my app a customer registers on mysite.com. Once registration is complete, they are given a site such as customer.mysite.com. I'm using Devise and would like to log the customer into their site immediately. I'm using multitenancy as explained in the RailsCast here. I'm not quite sure how to go about this. The standard solution of adding sign_in to an after_sign_up_path_for def isn't working. I'm assuming it's trying to log the customer into mysite.com, not customer.mysite.com. I'm including

Devise support for multiple concurrent sessions

余生长醉 提交于 2020-01-15 03:53:05
问题 I'm using Rails 3.2.11 with Devise 2.2.3 for a subscription service application. I inherited the app from another developer who is no longer available. I am new to Rails and Devise. I want to allow a single user (email) to have more than one session to the same app, running concurrently. The sessions may all have the same IP address or different IP addresses, though probably different devices -- desktop, laptop, table, smart phone. I want to treat each session independently, so the user can

Installing Active Admin and getting an ArgumentError

我们两清 提交于 2020-01-15 03:33:16
问题 I'm trying to use ActiveAdmin for my first time w/ Rails 4. Upon installing all dependent gems, I try to run the installer, i.e.: rails generate active_admin:install Doing so gives me the following error: in `add_route': Invalid route name, already in use: 'admin_root' (ArgumentError) However, I don't have any 'admin_root' route in routes.rb so I'm a little confused. Here's the output from running 'rake routes': Prefix Verb URI Pattern Controller#Action exams GET /exams(.:format) exams#index

Remove HTTPS from Devise confirmation link when using Rack::SSLEnforcer

六眼飞鱼酱① 提交于 2020-01-15 01:55:27
问题 I'm using Devise and Rack::SSLEnforcer in a Rails app. When users receive their confirmation email, it looks something like: http://mysite.com:443/users/confirmation?confirmation_token=123456789xxx The link is auto-generated by Devise's confirmation_url method. This link shouldn't have the port 443 attached to it. In theory, I don't need the link to be to the https address, but it's fine if it is. At minimum, it should be https at the front, not port 443 at the end. Any ideas? 回答1: I solved

Devise, Omniauth and multiple models with STI

[亡魂溺海] 提交于 2020-01-14 14:41:31
问题 I have an application setup with devise authentication using sti (base user model and two other models - company and individual - inheriting from it). From a devise perspective, everything is working. I can have different routes for signup forms and everything works as expected. Now I wanted to give both users (company and individual) the option to signup/sign in using facebook or linked in. If I set the :omniauthable on both models, and set the devise_for on my routes.rb for each model, I

Devise: Suddenly cannot log in anymore

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-14 09:46:08
问题 I'm using Devise 1.3.4 for authentication for the backend in my app. For a couple of days now I cannot log in anymore. What happens is: I go to the login page /admin/sign_in Log in with good credentials See in the log that the login worked (last_sign_in_at, current_sign_in_at and current_sign_in_ip are set, sign_in_count is increased) Devise sessions controller tries to forward me to the after_sign_in_path_for I specified in my application controller (Admin::DashboardsController#show) Then

signin user upon clicking the link in email automatically in rails application?

青春壹個敷衍的年華 提交于 2020-01-14 06:05:55
问题 I have a User model in my rails application. which is a "devise" model. i have one form called "user-info" form this form can be available once the user logs into the system. i have one admin login in which an admin can send the link to the user email like fill the "user info" by clicking a button . once the user clicks the button i want the user to login into the system automatically without redirecting to the login page. and should be navigated to the user-info form. i have an idea of