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
It would be nice to have UserProps exported so application developers can use it in their own code. For example,
exportconstwithAdmin=<TextendsUserProps=UserProps>(page: ComponentType<T>)=>{constPageWithAdminRequired=(props: T)=>{const{ user }=useUser()constrouter=useRouter()if(!isAdmin(user)){router.push('/')returnnull}return<Page{...props}/>}PageWithAdminRequired.displayName=`${Page.displayName}WithAdminRequired`returnPage}
Describe the ideal solution
#574 extracted the UserProps type. It would be nice to have that available in client code.
Alternatives and current workarounds
For now, I have this in my code:
/** * @auth0/nextjs-auth doesn't export this, so we copy the definition. * @see@auth0/nextjs-auth0/client/with-page-auth-required */exporttypeUserProps={user: UserProfile};
Additional context
No response
The text was updated successfully, but these errors were encountered:
Checklist
Describe the problem you'd like to have solved
It would be nice to have
UserProps
exported so application developers can use it in their own code. For example,Describe the ideal solution
#574 extracted the
UserProps
type. It would be nice to have that available in client code.Alternatives and current workarounds
For now, I have this in my code:
Additional context
No response
The text was updated successfully, but these errors were encountered: