Questions tagged [devise]
Devise is an authentication gem for Ruby-on-Rails. It supersedes previous solutions such as Restful Authentication or Authlogic.
15,024
questions
0
votes
0
answers
25
views
Testing Devise sign_in in a multi-threaded environment
I am using the following code to test multi-threading in a Rails app where users are handled by Devise.
test "multi-threaded sign-in with Devise" do
user1 = create(:user)
user2 = ...
0
votes
0
answers
44
views
Get previous authenticated user before warden.authenticat! got called when create new session with devise
Using:
Rails 7.1 (with API mode)
devise 4.9.3
postman for the following tests
First, I logged in with user A with email and password. I got what were expected.
But next, I try to login with user B ...
0
votes
0
answers
50
views
The change you wanted was rejected. Maybe you tried to change something you didn't have access to. in ruby on rails
I am using ruby on rails and I am add apple signin option its work on firefox but it gives error on
chrome
error on after login in from apple id
Why this error comes on chrome or when I trying to sign ...
0
votes
0
answers
38
views
Rails remote form not verifying authenticity token
In ruby on rails 6, I submit the following form:
<%= form_with url: "/subscribe_newsletter", local: false, id: "newsletter-form" do |f| %>
<%= f.email_field :email,...
0
votes
0
answers
17
views
How can I completly Remove devise from a rails 7 app?
I want to remove devise authentication from my app and use a different authentication method. Do I just follow this Answer, but it says nothing about the devise migration file
I tried to run a ...
0
votes
0
answers
19
views
Extending Devise integration test helper
Devise provides Devise::Test::IntegrationHelpers for testing purposes. The documentation defines a helper method for signing in but forces a nil to the basic method login_as scope.
# Signs in a ...
0
votes
1
answer
24
views
Devise Registration Ruby on Rails - Migration Error: Duplicate column name
I'm encountering an issue while running a Rails migration that adds Devise to my Users table. The error message points to a duplicate column name, specifically "email." The migration file ...
2
votes
1
answer
46
views
Timeout old sessions with Devise
I'm using Devise to manage login for my Rails app. I want to set a maximum session length: the user will be forced to log in again after 10 hours.
nb this is not Timeoutable. Timeoutable sets a ...
0
votes
0
answers
14
views
What is the best way to call an SLO endpoint when Devise times out?
I am using Devise's Timeoutable module. For users logged in with SSO, I want to hit the SLO endpoint on the Identity Provider when their session times out.
I'm trying to figure out the best place to ...
1
vote
0
answers
81
views
Devise 302 infinite redirect after password reset sent
In a Rails 6 app, I am using the Devise gem (version 4.9.3). In the development environment, when I try to reset a password, the outbound email is sent, but then I get a 302 redirect resulting in an ...
0
votes
0
answers
16
views
Detect existing Devise::Rememberable user before login
Is it possible, upon return to a non-Devise page, to determine if the user is a rememberable user (i.e. has had a previous session and has checked "remember me")?
Looking into the ...
0
votes
0
answers
63
views
Google Oauth callback outside of app domain in development
I encountered an issue recently when trying to add Google OAuth authentication to the admin of my app.
Our dev team works in a docker environment with a few different project containers all ...
0
votes
1
answer
22
views
How to build devise controller that can accept request from outside of the rails app
Here is the devise route:
devise_scope :user do
post 'log-in/testing', to: 'sessions#create_session'
end
and here is the controller:
class SessionsController < DeviseController
def ...
0
votes
0
answers
25
views
Devise-jwt - No Authorization header is present in the response
I'm encountering an issue with my API-only Rails application. I attempted to set up token-based authentication using Devise and Devise-JWT, but it seems that I'm not receiving the Bearer token in my ...
0
votes
1
answer
47
views
Cannot use the helper method `current_user` in devise
I am building a simple todo app with nextjs and rails.
I am using devise for user authentication, but I can't use current_user.
Specifically, I am using JSON API Serializer to return user information ...
0
votes
0
answers
29
views
Devise Masquerade with two layer login
I am using Devise with Masquerade & till now it's working fine for Admin & Company.
Now i have a requirement to login for Branch which will be under company.
i.e. I have an Admin who can ...
0
votes
0
answers
27
views
Make login fail in Devise so to show default error message
Using Rails and Devise. In the following code, I do a check whether user has already signed in with omniauth (check using email and provider fields). If yes, then I want to fail it with the default ...
0
votes
1
answer
75
views
Custom registration forms for different roles using Devise and Rolify on Rails
We're trying to create a conditional statement inside Devise's new registration form so that different fields are shown for different types of roles. The problem is that the role itself should already ...
0
votes
1
answer
45
views
How/Where does Devise/Warden generate the cache key used to store a session in Redis?
In my Rails application using Devise and Redis, I can call these things and get a session's ID:
# app/controllers/some_controller.rb
session.id
session[:session_id]
cookies['session_cookie']
The ...
0
votes
0
answers
27
views
How to Expire Session IDs in Cookies for Active Admin?
I'm facing an issue with the session management in my web application. I've noticed that the session ID stored in a cookie doesn't seem to expire, which poses a security risk. If someone obtains this ...
0
votes
0
answers
15
views
Is there a way to unsubscribe from Turbo StreamChannels after Devise logged out a user of inactivity?
I have multiple Turbo Channels and when they steam data to a subscriber who is already
logged out, because he was inactive, but he has not refreshed the page so he is still subscribed to the channel. ...
0
votes
0
answers
31
views
Ruby Upgrade from 2.7.7 to 3.0.0 Breaks Active Admin and Devise
I think this has something to do with the gem I'm using for memcache (dalli) but search results on this are scarce.
Rails 7.0.4
Ruby 3.0.0
Dalli 2.7.6
Devise 4.8.1
My site works (dalli is used for ...
2
votes
1
answer
378
views
Bumping to Rails 7.1 broke devise authentication, but not on development
I bumped my application to Rails 7.1, and on my development server, signing in using my Devise setup works fine. However, on my staging server (RHEL7 using nginx), authentication no longer works.
At ...
0
votes
0
answers
47
views
Devise issue, unable to sign in or sign out
I have:
// app/javascript/application.js
import { Turbo } from "@hotwired/turbo-rails"
Turbo.session.drive = true
But when i try to sign in /sign out I get:
NoMethodError in Devise::...
0
votes
0
answers
46
views
Stop Modal Form From Submitting If There Are Errors (Rails, Stimulus)
I am not sure this is the best solution, but currently I have a sign up/login form using Devise. The validation is covered by devise and that is why I have copied the form over to a modal which I want ...
0
votes
0
answers
17
views
Updating devise fields via checkboxes
Rails newbie here, please be gentle.
I've setup devise to give me some authentication on my application, and have added "Approved" and "Admin" columns to the user table to restrict ...
0
votes
1
answer
32
views
Rails 5 (from Rails 4.2) and Devise 4 (from Devise 3) Upgrade: Warden::Proxy Instance Not Found in Request Environment
So we’re in the process of upgrading an old Rails 4 app. We’re currently trying to jump from Rails 4.2 to 5.0. Part of this involves upgrading Devise from version 3 to version 4. We’ve been jumping ...
0
votes
0
answers
36
views
How to keep modal open if errors exists for devise?
I have a Modal that has a devise form for authentication. If I click keep the fields clear and click on 'Sign Up', the errors do appear on the modal but the modal closes. How do I keep the modal open ...
0
votes
0
answers
36
views
Customize devise error messaging to work with tailwindcss
The main problem, I cant figure out how to stylize devise error messages with tailwindcss. I can create my own stylized flash messaging, but then I cannot figure how to use that in place of devise's ...
0
votes
1
answer
42
views
How to route with Devise with subdomains?
I'm working on a Rails apps that uses an app subdomain. For example, if a user visits my application at www.mysite.com and logs in, they should be redirected to app.mysite.com/ (which should be the ...
1
vote
2
answers
60
views
Rails 7, return active record association with two separate conditions, one in the parent, one in the child
I have an Applicant model, that has become the location or a chat between a project owner and an applicant to that project.
I track the applicant by using an applicant.user reference in the Applicant ...
0
votes
1
answer
40
views
Devise invitable: Resend custom invitation with token
I am using a third party email service to handle all my emails and I am running into an issue when attempting to resend an invitation to a client.
When I attempt to perform the following, there is no ...
0
votes
0
answers
89
views
Rails 7 - Devise overriding Registrations controller
I am using Devise gem in my Ruby on Rails application. I want to have a functionality where a logged in user can create a new user. I know Devise default behavior and I am being routed to the root ...
0
votes
0
answers
28
views
Rails 5 - Validate devise users email based on scope of two dynamic attributes
How can I validate a users email based on some condition thereby overriding devise default VALIDATABLE feature.
Users table has company_id(has one role as owner) and institution_id(has two roles as ...
0
votes
0
answers
36
views
Rails Devise Invitable gem resend invitation
I need to resend invitations to users on my app. I know Devise Invitable has a resend_invite method, so calling invite! will resend a new invitation with a new token, but my question is how do I ...
1
vote
1
answer
228
views
Can't pass current_user into rails 7 turbo stream
I am trying to learn turbo with rails and have come to a problem that I can't seem to figure out. I have a structure where every Applicant has Messages. Two users can send messages to each other ...
0
votes
1
answer
106
views
Seeding Users with Rails 7/devise
I am making a Rails 7/React application (a rudimentary POS system) in which I am utilizing the devise-api and devise-security gems for authentication and session limiting. After reading other threads ...
2
votes
0
answers
271
views
Apple SSO Callback returns OAuth2::AccessToken.from_hash `hash` contained more than one 'token' key
I am trying to implement Apple SSO using the omniauth_apple gem in Ruby on Rails.
In my devise.rb, i have the following config
config.omniauth :apple, Rails.application.credentials.dig(Rails.env....
0
votes
0
answers
54
views
Omniauth Facebook - Implementation not working in Rails
I keep getting the following page when trying to log in using Facebook in Rails 5.2: Sorry, something went wrong.
We're working on getting this fixed as soon as we can.
The details to the app were as ...
1
vote
1
answer
47
views
NoMethodError: undefined method `[]' for nil:NilClass when creating a new session and passing session parameters
As i received advice from stack overflow, I was conducting functional tests in integration test file however when i am creating a user sign in test session , I am getting the following error:
Finished ...
0
votes
0
answers
54
views
devise confirmable with React
There is a problem I couldn't find an answer for on the internet.
I am trying to make an app with react and ruby.
I am using devise in order to authenticate my users and I would like to use the ...
1
vote
1
answer
51
views
Ruby on Rails: sign out isn't working for devise with User
I have the following routes:
I'm developing an exercise tracking app and I want to have tracked_exercises for the currently logged in user. This is my routes.rb file:
Rails.application.routes.draw do
...
0
votes
0
answers
36
views
Ldap "simple bind" authentication with devise_ldap_authenticatable
I have to configure devise_ldap_authenticatable for "simple bind" mechanism, using a username not in the DN form.
For example, with username=foo.bar,dc=example,dc=com we use this ldap.yml ...
0
votes
1
answer
62
views
How do i add custom fields to Devise-invitable
I have generated the view with rails generate devise_invitable:views
I have also edited the generated views in users/invitations/new.html.erb to include the fields I want to include first name and ...
1
vote
1
answer
65
views
Ruby on Rails - Devise model validations
I am working on a Ruby on Rails application, and I am using Devise gem for authentication. I have noted that I am able to sign up as a new user, but all the data of a user is not getting stored into ...
1
vote
1
answer
116
views
Problem with making a devise scaffolding generator
I am trying to build a scaffolding generator for Devise and I am having a problem with getting my tests to pass when I uncomment the line source_root=File.expand_path("../../templates/controllers&...
0
votes
1
answer
164
views
Chromedriver getting rejected by test database
Have 2017 Rails project I'm trying to write Rspec tests for. It uses Capybara, FactoryBot and Devise.
I'm using Chromedriver, which fails to sign in the user during the first Rspec system test - the ...
0
votes
1
answer
50
views
How to force re-login with Devise and Warden without logging out the user?
Need to add a feature so that a user is required to log in again. However, they cannot be signed out.
I was able to create a new sign in page that does not redirect if they are already logged in.
...
1
vote
1
answer
50
views
Ruby on Rails authentication: Devise Signup not working [closed]
I am new to Ruby and Rails and I am setting up authentication using Devise gem. I am receiving the below error when I try to sign up a new account.
TRANSACTION (0.2ms) BEGIN User Exists? (0.5ms) ...
1
vote
1
answer
45
views
Ruby on Rails Sign in Issues ( Used Rails admin Devise)
Recently we are planning to upgrade the Ruby on Rails app (Ruby 2.7.2 to 3. , Rails 5.2 to 7.)** . After upgrading the versions we tested in local it is working as we expecting, then we deployed the ...