V
V
VladimirKrasnov2021-01-04 17:01:41
Laravel
VladimirKrasnov, 2021-01-04 17:01:41

How to authorize a verified user?

Hello, I'm doing a project on the lara and faced such a task.

It is necessary for me that only the user whose status is "active" could log in to the site.

I did this.. As soon as the user has registered on the site, a record is created in the database with his entered data, where the default status is "no active". At the same time, the user is not allowed to enter the site after registering, but a flash drive is displayed, such as an activation message was sent to your mail and redirected to the main one.

Authorization on the site was also closed with a check, overriding the authenticated () method, inside a simple check that if the status is not "active", then go away and again a flash drive, go to the post office.

The problem is, when a Verify Email Adress letter arrives in the mail, the user clicks on it and gets back to the authorization page, because the 'auth' intermediary is triggered and the user is again offered to go to the mail, and so on ad infinitum.

And the status "Active" can be assigned only after the user follows the link from the letter and logs in.

How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pLavrenov, 2021-01-04
@pLavrenov

Um .. maybe it's worth sticking out the mail activation route from the group to which the authorization middleware is specified?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question