Created
August 8, 2018 22:34
-
-
Save whoisryosuke/cc032c1dba57f19a11a87bc6c2e2d4f9 to your computer and use it in GitHub Desktop.
NextJS - (better) HOC for authenticating pages using JWT token stored in cookies. HOC checks for cookie, if it doesn't exist, user is redirected using res or Router (ideally also query API to verify token). Wrapped in an optional context provider to pass JWT down.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment