Questions tagged [devise]
Devise is an authentication gem for Ruby-on-Rails. It supersedes previous solutions such as Restful Authentication or Authlogic.
14,475
questions
0
votes
0answers
10 views
Allow logins with different IDs on the same machine with RAILS 4 and devise
What I am trying to achieve is for a person with two differents login/passwords combinations to be able to login simultaneously into their 2 different accounts on a unique rails 4 app using devise.
...
0
votes
0answers
6 views
Devise sign_out on load balance not working
I am trying to detect user inactivity and log out the user, below is relevant part of my code
JS Code
Session.inactivity().then(function() {
localStorage.removeItem(...
0
votes
1answer
14 views
Capybara/Rspec - Session Lost on second scenario with Ajax request
I'm beating my head on trying to solve this issue. I have a feature spec that I'm writing where I have multiple scenarios written and I want them all to run within the same user session. The tests run ...
0
votes
1answer
9 views
Ruby on Rails Routes for custom Devise Signup and Signin forms
I hope all is well. Im trying to edit sign up and sign form but my edits for the views/users/registrations and sessions directories wont take any effect. Am I doing something with the route?
Thank you
...
0
votes
1answer
22 views
Rails: sign_out current_user not working?
I am trying to logout a user session after idle time. I have a controller action in sessions_controller.rb with the below code.
def inactivity
flash.now[:alert] = 'Logged out due to inactivity.'
...
0
votes
0answers
19 views
early return on devise active_for_authentication method
I have two user types, Parent and Child.
I have an active_for_authentication method on Child which uses a is_suspended column on Child which works perfectly.
However a Parent can 'masquerade' into a ...
0
votes
1answer
18 views
Devise Registration controller/page behavior
Is there a way to avoid :require_no_authentication callback to be called?
Adding before_action :authenticate_user! in the controller does nothing. I guess its because of the :...
0
votes
1answer
22 views
Different Devise configurations for each model
I have two models which are using Devise for authentication: User and Uploader with strictly separated pages and views (the former has access to the app, the latter just to one upload view).
I ...
1
vote
0answers
13 views
Managing Devise User rights for free vs premium account + Ruby on Rails [closed]
I have a website that has 2 type of users.
Free users can post until 500 item.
Premium users can post unlimited.
Initially I was thinking to check if current_user.post.count > 500 and turn off ...
0
votes
0answers
16 views
How to use Devise omniauth feature without using additional gem for provider?
I developed myself to get access token and user information from Azure without using any additional gems for providers (all existing gems for Azure are not good, I have to say). All I'm using is the ...
1
vote
1answer
19 views
Devise gem: Single project with multiple login strategies
I have a Rails app using device with its default login strategy (e-mail/password) for a specific model (Admin). Admins can login through the /admin route.
Now I want to allow my mobile app users (User ...
-2
votes
2answers
33 views
Is there any way i can check if the user is not active since x months [closed]
I'm using rails 6 and devise for authentication. I know it can be done with session but dont know how. I will be thankful for your kind response.
0
votes
1answer
25 views
How to have strong parameters on devise 'edit' view?
I followed these instructions and now have time_zone as a field when the user signs up.
However, the user cannot edit that field, when I try:
Unpermitted parameter: :time_zone
What I know
Since the ...
0
votes
1answer
26 views
“User last online” at <time> using devise?
Is there any easy/native way to display when a user was last online on their profile page using a standard rails app using devise for authentication?
The closest I can get is
<%= @user....
0
votes
0answers
15 views
How to use devise to authorize user from my callback method? Like SSO
In my user controller, I have a callback (oauth2_callback) method (using 'oauth2' gem only) which is working and I can get user confirmation through 3rd party API. Once I validate this user is ...
-1
votes
1answer
51 views
Facing a NoMethodError and unable to pinpoint the source
I added the devise gem to my rails app. Then I appended the url with user/sign_up as that is self created by the app. Then the following page shows up -
I am unable to locate the file with the ...
0
votes
1answer
16 views
Which table to put user account attributes in database table when using Devise?
I am using Rails as my framework for a web-application. I'm using Devise to setup authentication for my application. Devise automatically creates a user table, which includes columns such as email, ...
0
votes
0answers
17 views
Redirect to stored location after confirmation, devise
In my ConfirmationsController a user is signed in automatically and then is being redirected to a view, which basically just says, hey, you registered sucessfully
def after_confirmation_path_for(...
0
votes
1answer
32 views
Reset password token mismatch issue in Devise
I'm building an app using Devise.
The problem I have is about the password reset process.
If the user forgets their password, enter the registered email address and send a password reset notice to ...
0
votes
0answers
16 views
Rails Devise Different Password Validation Policies by User Roles/Permissions
I have an app build in Ruby on Rails. I use Devise and Devise-Security Gems for authentication.
Is there a way to use different policies between Administrators and Users
Example, I would Like my ...
-1
votes
1answer
29 views
Display modal (only 1 time) after first login with Ruby on Rails + Devise
I'm trying to show an introduction modal to new user after the first sign in.
<% if user_signed_in? && current_user.sign_in_count == 1 %>
<%= render 'introduction_slides' %>...
0
votes
0answers
12 views
Using multiple authentication keys and signin methods with devise on the same model
The following article indicates how to change the login authentication key from email to another field.
It alludes to identifying the key as being an element in an array, giving it a name that is ...
0
votes
0answers
6 views
How to fix Devise crashing with Mobylette?
My Rails 5 app crashes on mobile devices when users try to to log in. I'm using Devise for logging in, and Mobylette for mobile views.
There error I get is:
ActionController::MissingRenderer in ...
0
votes
1answer
28 views
Rails upgrade 3.2.* to 4 Does not show all user attributes in rails console
Kind of an odd bug I am running into. Working on upgrading a Rails app from 3.2.22.1 tp 4.2.11.3. Everything is working pretty well. Test suite is passing on green. However when I go into the ...
0
votes
1answer
22 views
How to make devise not require authentication for home page?
I have before_action :authenticate_user! in the application controller, which is very efficient because it applies to all controllers but there's one page (home page) that should be available without ...
0
votes
0answers
12 views
Custom strategy for warden not getting called
I am trying to use a different warden strategy to authenticate my action cable end points.
But the strategy is not getting called. I tried to place warden.authenticate!(:action_cable_auth) in a ...
-3
votes
0answers
18 views
Carrierwave for Rails “POST /posts HTTP/1.1” 302
I'm trying to create a social media clone that is implementing a photo-uploader as a project for my Rails app. I've followed some guides online, as well as, the Carrierwave documentation.
I'm trying ...
0
votes
1answer
22 views
Devise Sign in button unresponsive once placed in an html container
I am trying to get a better understanding of how to join my front end and back end code in my rails application. I have created a VERY basic devise user, simply to practice applying the html and css. ...
0
votes
1answer
26 views
Problem with Devise to add email confirmation
I want to add email confirmation in my rails app with Devise. I got this error message:
"NoMethodError in Devise::RegistrationsController#create
undefined method `confirmation_instructions' for ...
0
votes
1answer
35 views
Rails nested resource returning incorrect ID in params hash
I am trying to make a simple app for submitting goals of users, who can then mark the goals as completed. I can complete the "new" action fine, but when I'm trying to "edit," the ...
0
votes
1answer
51 views
No such column users.remember_token
I try to use rememberable on my app in really simple way, but when I check the remember_me checkbox I got the following error
SQLite3::SQLException: no such column: users.remember_token: SELECT "...
0
votes
0answers
21 views
getting this error when trying to run rails generate devise:install
/home/winifredf/.rvm/gems/ruby-2.6.1/gems/activesupport-6.0.3.2/lib/active_support/message_encryptor.rb:206:in rescue in _decrypt': ActiveSupport::MessageEncryptor::InvalidMessage (ActiveSupport::...
0
votes
1answer
17 views
Ruby on Rails Devise won't accept user sign up due to ActionController::UnknownFormat (ActionController::UnknownFormat):
I've set up my application with Rails API backend and Vue.js + Devise for authentication. When I try and sign up a new user from my application it sends out a 406 error along with ActionController::...
0
votes
1answer
22 views
How to set email as optional in devise and use recoverable?
Email is optional in devise and recoverable is on:
class User < ApplicationRecord
devise :database_authenticatable, :confirmable,
:recoverable, :rememberable, :validatable, :trackable,
:...
0
votes
1answer
51 views
Where query in rails
I have a rails application with two tables. One is the users (devise model), with email and password. The other is products that belongs_to users.
When an user login on the app (with his email and ...
0
votes
0answers
25 views
Rails devise can't find current_user from safari browser while redirection
I'm facing a weird behavior on mac safari browser as I opened a popup window and fb login and redirect. Cookie is secure, HTTPonly, and time-based. I'm on https also. The same stuff is working with ...
0
votes
0answers
30 views
Callback just before session timeout after inactivity in rails?
I am using Devise Timeoutable feature for session timeout with Rails 6.
I want to delete a token just before the session timeout incase of inactivity from the database.
Is there a way to call a method ...
1
vote
1answer
55 views
Share Devise session cookie between two Rails apps of different versions
I'm trying to share a Devise session cookie for authentication purposes between two Rails apps on the same TLD but living on different subdomains. One app is v4.2.11.1, and the other is v6.0.3.2. I ...
1
vote
2answers
104 views
Rails 6, Devise and Active Storage
I'm using Devise and Active Storage in my rails 6 application. Currently using before_action: authenticate_user! disables all images for non users, which is great, except I want to allow images with ...
0
votes
1answer
33 views
Trouble signing in with Devise - JSON.stringify escaping characters
I'm having trouble signing users with Devise because of the format of the credentials that get sent to the users/sign_in route. Here's my client side code for sending the request:
async function ...
0
votes
1answer
29 views
Devise authenticate_user redirects to new session path
Devise authenticate_user! method redirects to new session path Users::SessionsController#new. Is there a way to configure this to redirect to the new user path?
Started GET "/" for ::1 at ...
0
votes
1answer
28 views
How to embed a route resource in a Devise route in Rails 6
Under normal circumstances if one wants to embed resources within other resources in Ruby on Rails in the routes.rb file it would look like this:
# routes.rb
resources :parents do
resources :...
0
votes
1answer
39 views
Rails devise-jwt session storage
The devise-jwt gem documentation says that if session storage is enabled, you have to skip it for jwt auth. It says that you should set on devise.rb:
config.skip_session_storage = [:http_auth, :...
0
votes
1answer
33 views
How to edit create registrations_controller action using devise?
I'm making a simple app that has the traditional User model, but also a Patients model. I want a user to automatically become a patient on sign up.
I've managed to follow instructions here, and can ...
-1
votes
1answer
19 views
Allow multiple users with same email with Devise Token Auth
I'd like to allow multiple users with the same email to be created, using devise-token-auth.
Rather than this error being thrown.
@details={:email=>[{:error=>:taken, :value=>"testttt@...
1
vote
0answers
27 views
No resource_class found (omniauth)
Adding twitter omniauth login in my-app, an error message saying "RuntimeError (No resource_class found)" came out.
Processing by Api::V1::Auth::OmniauthCallbacksController#omniauth_success ...
0
votes
1answer
31 views
How to print a controller as text in the rails console?
I'd like to view Devise::RegistrationsController (out of curiosity, as I'll inherit from it as shown here)
I tried the obvious rails c then puts Devise::RegistrationsController and a few variations (e....
0
votes
0answers
24 views
Add routes for users after setup with devise?
I have setup a blank app with devise and the routes look like so:
devise_for :users
Since devise already set up the model, I used rails g scaffold_controller users to generate the controller.
(I ...
1
vote
1answer
34 views
Two models with one controller using devise, problems with validations and error messages
I have two models in my app, one 'user' model with devise, one 'employee' model made by scaffolding.
I need a way to have the employee table populated as soon as a new user registers, both tables ...
0
votes
0answers
14 views
Modify Login Flow for Devise Application using OmniAuth
We have an auth service built on rails/devise/omniauth. Right now or login page looks something like:
Login with Email
Email: _________
Password: _________
-------- OR -------
Sign in with Google
...