jeudi 2 juillet 2015

How to "lock" user to certain page?

there is a common scenario when user is not allowed to use app until he provides required data/confirms his email or phone number: after authentication he is allowed to access only one page where that condition can be satisfied. For example, enter code from sms, fill in profile data, etc.

One of the possible approach is to inherit all authenticated routes from the BaseRoute and have a conditional redirection in it's beforeModel hook. But that looks brittle, imo.

What are other strategies, techincs to implement that kind of feature?




Aucun commentaire:

Enregistrer un commentaire