Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 997 Bytes

2021_08_19.md

File metadata and controls

26 lines (21 loc) · 997 Bytes
  • DONE [[Nextjs]] [[next-auth]] Next open source auth library Next-auth doing:: 1630122165352 done:: 1630122202158
  • DONE [[Auth0]] [[Nextjs]] [[Authentication]] [[nextjs-auth0]] Common used functions from the nextjs-auth0 library: doing:: 1629416470717 todo:: 1629416477829 done:: 1630121598259
import { useUser, withPageAuthRequired } from "@auth0/nextjs-auth0";
const Profile = () => {
	const { user, error, isLoading } = useUser();
	if (isLoading) return <div>Loading...</div>;
	if (error) return <div>{error.message}</div>;
	if (!user) return <Link href="/api/auth/login"><a>Login</a></Link>;

	return <div>Hello {user.name}, <Link href="/api/auth/logout"><a>Logout</a></Link>< /link 

// Then wrap exported function as such
export default withPageAuthRequired(Profile);
  • TODO [[Coding Workflow]] Fix Buttons/Links on Contact.js page of Flask-Ecommerce project
  • TODO [[Coding Workflow]] Merge Nextjs Flask-Ecommerce-1 with master branch