111 questions
0
votes
1
answer
82
views
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 ...
2
votes
1
answer
350
views
How do I set the port correctly in email links during a system test?
I'm writing a System test to confirm the entire sign up flow is working in a Rails 7 app (with the Clearance gem and an email confirmation SignInGuard).
The test is working fine right up until I "...
0
votes
1
answer
129
views
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):
<div class="...
0
votes
0
answers
62
views
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 #...
0
votes
1
answer
134
views
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 ...
0
votes
1
answer
58
views
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 ...
-1
votes
1
answer
540
views
Show user id/name in Rails log with Clearance gem
I'm looking for a way to show the current user on each line in the Rails logs. E.g.
[johndoe] Started GET "/" for 127.0.0.1 at 2020-06-07 01:10:33 +0000
Some research suggested using the rails config....
1
vote
0
answers
207
views
Extending Rails ThoughtBot/Clearance gem for password rotation
I love the ThoughtBot Clearance gem (https://github.com/thoughtbot/clearance) for Rails authentication. But I'd like to expand my knowledge base in what/how I can make it more-better :)
I've used ...
2
votes
1
answer
961
views
Clearance and 2FA (or MFA)
I'm using Clearance for authentication on my Rails app. More and more of my users ask me to implement some kind of 2 Factor Authentication. I am thinking that when signed in, users could opt-in to use ...
1
vote
1
answer
119
views
How to set Session length for a User in Clearance?
How do I kill the session cookie for a user that closes their browser and or a day passes in Clearance?
I do see the following config vars, but I believe the cookie expiration is for the general ...
0
votes
1
answer
56
views
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 ...
1
vote
0
answers
142
views
404 error when submitting forms / chat messages
I'm very new at Ruby on Rails and I'm trying to follow this tutorial (https://scotch.io/tutorials/asynchronous-chat-with-rails-and-actioncable?fbclid=...
1
vote
1
answer
317
views
BCrypt InvalidHash with Clearance password resets
I'm new to Rails, coming from a PHP + Python background. I'm setting up a development environment on my machine based on a production database dump.
I can't log in to my dev environment because every ...
2
votes
0
answers
323
views
current_user nil while using omniauth with clearance
This is my sessions controller
class SessionsController < Clearance::SessionsController
include ActionView::Layouts
include ActionController::Flash
def create
user = AdminUser....
1
vote
0
answers
196
views
Clearance login and login redirect breaks after upgrading from Rails 6 beta1 to Rails 6 beta 2
I'm using the Clearance gem for authentication on an app that I started new with Rails 6 beta 1. Everything was working fine, but when I tried to upgrade to Rails 6 beta 2.
I've also tried the ...