Merge pull request #10740 from colinux/debug-email-verified

ETQ tech et super-admin, je veux voir rapidement si un user a son email verifié
This commit is contained in:
Colin Darie 2024-09-09 07:23:32 +00:00 committed by GitHub
commit 6e9fb7f247
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -36,7 +36,7 @@ class Users::ActivateController < ApplicationController
user = User.find_by(confirmation_token: params[:token]) user = User.find_by(confirmation_token: params[:token])
if user && user.email_verified_at if user && user.email_verified_at
flash[:notice] = "Votre email est déjà vérifié" flash[:notice] = "Votre email est déjà vérifié"
elsif user && 2.days.ago < user.confirmation_sent_at elsif user && user.confirmation_sent_at >= 2.days.ago
user.update!(email_verified_at: Time.zone.now) user.update!(email_verified_at: Time.zone.now)
flash[:notice] = 'Votre email a bien été vérifié' flash[:notice] = 'Votre email a bien été vérifié'
else else

View file

@ -12,6 +12,7 @@ class UserDashboard < Administrate::BaseDashboard
ATTRIBUTE_TYPES = { ATTRIBUTE_TYPES = {
id: Field::Number.with_options(searchable: true), id: Field::Number.with_options(searchable: true),
email: Field::String, email: Field::String,
email_verified_at: Field::DateTime,
confirmed?: Field::Boolean, confirmed?: Field::Boolean,
created_at: Field::DateTime, created_at: Field::DateTime,
updated_at: Field::DateTime, updated_at: Field::DateTime,
@ -41,6 +42,7 @@ class UserDashboard < Administrate::BaseDashboard
:id, :id,
:email, :email,
:confirmed?, :confirmed?,
:email_verified_at,
:current_sign_in_at, :current_sign_in_at,
:created_at, :created_at,
:blocked_at, :blocked_at,