impersonate unverified user
I'm facing an issue where I'm unable to impersonate a user who hasn't verified their email. As an admin, I'm trying to impersonate the user even though their email is unverified. However, the system still prompts me to verify their email. Could you please provide guidance on this?
8 Replies
You need to check the user model, if you have the requirement, that a user needs to have verified email
If that's so, then you cannot impersonate
As an admin, I believe I am able to do that by bypassing this requirement.
Something like this:
And I have checked this class EmailVerificationPrompt
My question is, is there another way to currently achieve something like this?
just fill in the 'email verified at' col on said user
or just yk, actually verify the email?
if you dont want it disable it? its yes or no xd
I (admin) don't want to mark 'email verified' because I still need regular users to verify their emails.
why do u even need to impersonate them?
sounds like bad practice to begin with
only in tests you "act as" a user
Create a custom EmailVerification class and pass that into the emailVerification() method
use Laravel Gate before() method to bypass as a super admin
I ended up fixing the issue like this.
And customer email verification works as well. Thank you all.