-
Notifications
You must be signed in to change notification settings - Fork 69
Fixed "Remember me" in Login #380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @@ -1,5 +1,7 @@ | |||
| <% flash.each do |key, value| %> | |||
| <div class="alert alert-<%= key %>"> | |||
| <% next if key == 'timedout' %> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
related: heartcombo/devise#1777
app/controllers/posts_controller.rb
Outdated
| @@ -1,4 +1,6 @@ | |||
| class PostsController < ApplicationController | |||
| before_action :authenticate_user! | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 no, no? 😂
|
This test fails |
|
Yes, offers and demands (Post) are public, the view of post changes if you are logged in or logged out. Showing or not de member contact data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to:
- remove the authenication step on
PostController - check that the "remember me" think actually work, it wasn't last time I checked. Can we add sme step in the description on how to test this? Thanks!
app/controllers/posts_controller.rb
Outdated
| @@ -1,4 +1,6 @@ | |||
| class PostsController < ApplicationController | |||
| before_action :authenticate_user! | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 no, no? 😂
| 'alert-info' | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll create an issue where we can discuss this, I prefer to tackle it in a different PR since we already tested it 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| <div class="alert <%= alert_class(key) %>"> | ||
| <button type="button" class="close" data-dismiss="alert">x</button> | ||
| <ul> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we fix indentation here 🙏 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do it in the next PR 💪
|
@mllocs I'm testing this branch in staging, I set When
|
|
Tested, it actually works 😬 |
Here I'm trying to make the "Remember me" option work, which will be the default option in the mobile app.
Instead of expiring the session the hard way, I'm using the
timeoutabledevise module. I'm also configuring therememberablemodule to remember sessions for 4 weeks.I also did a little cleanup on the
alertbootstrap component, so, instead of using our own styled alert messages, I'm using bootstrap ones, which look exactly the same :DI also updated devise from 4.4.1 to 4.4.3 🚀
UPDATE
How to test:
Change
config.remember_forandconfig.timeout_inin your environment. In the gif, timeout_in was set to 5.seconds and remember_for to 10.seconds. With those values:In the gif you can also appreciate another case:
When you are kicked out and you go to a public page (like offers or demands), you'll see a flash message saying that your session expired but you are not redirected to the login.
Instead, if you navigate to a page where you need to be looged in to see, whenever your session expires you'll be redirected to the login page and you'll see the flash message there as well.