Skip to content
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

feat(auth): Add user last login informations #3242

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

jdenquin
Copy link
Contributor

@jdenquin jdenquin commented Feb 24, 2025

  • Add users last_login_at and last_login_method
  • Impact all auth services for this change
  • Require password only on users creation for validations (this made us unable to update a user)
  • Expose those new fields for GraphQL

@jdenquin jdenquin self-assigned this Feb 24, 2025
@@ -19,20 +27,26 @@ class User < ApplicationRecord
has_many :subscriptions, through: :customers

validates :email, presence: true
validates :password, presence: true
validates :password, presence: true, on: :create
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to allow empty passwords on update I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will not override password if its nil? (since the password digest should stay)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only other solution we have, is to disable validations for the update on the touch method

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how can this validation fail on touch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it always fail and say that the password is empty, we do not have any password field in DB thats why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants