Closed j-jalving closed 1 month ago
Hey @j-jalving, thanks for the suggestion. However, I excluded that feature from the package on purpose, here are the reasons:
email_verified_at
, or this field may have a different name (since it is not restricted on the backend side). Thus, I would need to add customization in the nuxt.config.ts
with a field name or something like that, which will complicate the module and decrease the flexibility.With that being said, this part was extracted into breeze-nuxt application template, if you want to contribute, feel free to open a PR there with unverified
middleware.
Makes sense, thanks for the comprehensive answer! I'll look into adding the unverified middleware and close this request for now.
Have you ever though about adding
sanctum:verified
andsanctum:unverified
middleware?sanctum:verified
This middleware would check if the user is authenticated AND if the user returns aemail_verified_at
field that is not null.sanctum:unverified
This middleware would check if the user is authenticated AND if the user does not have aemail_verified_at
field (or it is null).A new config value for
redirect.onUnverifiedOnly
should be added so unverified users can be automatically redirected to an e-mail verification page.