You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The withAuthRequired helper is useful for pages which should only be accessed by authenticated users, but there is a use-case for pages which are public, but could still take advantage of a user server-side prop when a user is authenticated.
It would be great to do something along the lines of renaming withAuthRequired to withAuth, and make authRequired a boolean argument – if true, redirect if no user is authed, if false, continue but set user to null.
There are clearly other options re naming the arguments etc.
The text was updated successfully, but these errors were encountered:
The
withAuthRequired
helper is useful for pages which should only be accessed by authenticated users, but there is a use-case for pages which are public, but could still take advantage of auser
server-side prop when a user is authenticated.It would be great to do something along the lines of renaming
withAuthRequired
towithAuth
, and makeauthRequired
a boolean argument – iftrue
, redirect if no user is authed, iffalse
, continue but setuser
tonull
.There are clearly other options re naming the arguments etc.
The text was updated successfully, but these errors were encountered: