Questions tagged [clearance]

Clearance is a Ruby gem for authenticating users with email and password in Rails apps.

Clearance is a Ruby gem for authenticating users with email and password in Rails apps. https://github.com/thoughtbot/clearance

112 questions
1
vote
2 answers

Session timeout using Clearance in a Rails app

I'm using Clearance for authentication in my Rails app. Does anyone know of a way to configure a session timeout? It's been logging me out within 5 minutes of when I login and I can't seem to locate anything that specifies how to set the timeout.
msaunders
  • 131
  • 1
  • 6
0
votes
1 answer

Override method of UsersController in Clearance

I want to change the def url_after_create '/' end of UsersController in Clearance. If I do this: class UsersController < Clearance::UsersController protected def url_after_create '/dashboard' end end When I'm trying to sign…
Nobita
  • 23,519
  • 11
  • 58
  • 87
0
votes
1 answer

Railties is causing rails g not to work

When I try rails g clearance:install or rails g sorcery:install it fails and responds with: /Users/superhappyfuntime/pikipik/config/initializers/devise.rb:3: uninitialized constant Devise (NameError) from…
weddingcakes
  • 653
  • 1
  • 7
  • 14
0
votes
1 answer

Rails: Clearance: Can you re-enable the email confirmation feature?

I am trying to using the Clearance gem for a Rails application to handle authentication, but I see at some point they removed a feature for email confirmation. Does this feature still exist? If so, how do you enable it?
mydoghasworms
  • 18,233
  • 11
  • 61
  • 95
0
votes
1 answer

How to extend clearance's back door to allow for 2FA

I have an application which uses the Clearance gem for authentication, but also implements 2FA. I want to use the "Backdoor" functionality of Clearance for tests, but am unsure how to do this in conjunction with 2FA. Is there a way I can "hook into"…
tsvallender
  • 2,615
  • 6
  • 32
  • 42
0
votes
0 answers

rails clearance confirmation token shows null in db

sign_up is ok. but when I want to sign_in using clearance gem. shows Completed 401 Unauthorized. my application controller code is: class ApplicationController < ActionController::Base include Clearance::Controller protect_from_forgery with:…
0
votes
1 answer

How to correctly apply CSS styles to HTML element Clearance templates? (Ruby On Rails)

I'm using bootstrap 5 for fastest applying styles, but when I trying to apply styles for HTML element template, I have this: Before applying After applying Code (.html.erb):
0
votes
0 answers

User object is sometimes nil in Clearance SessionsController after successful sign in

I've assumed that if status.success? is true then I could rely on @user being present. But sometimes I get an error that @user is nil. How is it possible that the reference to @user within #track_sign_in would sometimes be nil? class…
Lauren
  • 97
  • 2
  • 11
0
votes
1 answer

Verifying user is authorized after using redirect_back

I have a method that creates a new user session and will redirect back to the previous screen after successful login. It has introduced a security issue where someone can type in a url navigate to a page they shouldn't have access to. The app will…
0
votes
1 answer

Overwrote thoughtbot/clearance user.rb not working

I wanted to add a new Boolean attribute to my user: is_student My project has 2 types of users: students & faculty. If is was a student is_student should be true and if it is faculty is_student would be false. To add this new param I wrote this code…
Joey O'Neill
  • 124
  • 1
  • 6
0
votes
1 answer

undefined method `cookie_expiration' for nil:NilClass

getting a no method error while using clearance for authentication, i was trying to create a user using sign_up clearance (0.11.1) rails 3.0.7 ruby 1.8.7 on Windows XP. activesupport (3.0.7) lib/active_support/whiny_nil.rb:48:in…
Satish
  • 6,457
  • 8
  • 43
  • 63
0
votes
1 answer

How to display a user's posts only. Not others

This app is for tutors. When a tutor finishes a class, they fill out a class_report. Then the index page should display only their class_reports. Here's my problem: I've made two accounts, test1 and test2. test1 can see both test1 and test2's…
bendub89
  • 60
  • 7
0
votes
1 answer

How to set up password reset emails from gmail with clearance?

I'm trying to create a clearance password reset email to send from a gmail account I created. What do I have to do to accomplish this and send the password reset email when someone clicks "reset password"? I already set config.mailer_sender =…
Alien
  • 75
  • 7
0
votes
1 answer

How to lock down an entire Rails app until a User completes their account set up

I have a rails app that uses the Clearance for signup and login. After signup the user is redirected to accounts/new to complete their account setup. The Account belongs_to User and the user has_one account. (The Account and User models are separate…
0
votes
0 answers

How to override method url_after_denied_access_when_signed_out in rails using clearance lib to change redirect url?

I am using clearance library for my ruby on rails application auth, but I need to customize view with my template login, I already override sessions method like this and it works but not for url_after_denied_access_when_signed_out method. also I…