Skip to content

Instantly share code, notes, and snippets.

@audrl1010
Last active February 21, 2019 08:32
Show Gist options
  • Save audrl1010/1cc2b45d697d288b81009e99273ac1c2 to your computer and use it in GitHub Desktop.
Save audrl1010/1cc2b45d697d288b81009e99273ac1c2 to your computer and use it in GitHub Desktop.
approach auth in Next.js
const Secret = ({ loggedUser }) => (
  <div>
    <Content>
      Hi <strong>{ loggedUser.email }</string>. This is a secure page!
    </Content>
  </div>
);

Secret.propTypes = {
  loggedUser: PropTypes.object.isRequired
}

export default securePage(Secret);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment