This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react' | |
import { NextPage } from 'next' | |
import { useAuth0 } from '../lib/auth0-spa' | |
interface Props {} | |
const Page: NextPage<Props> = () => { | |
const { isAuthenticated, loginWithRedirect, logout, user } = useAuth0() | |
return ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react' | |
import { NextPage } from 'next' | |
import { useAuth0 } from '../lib/auth0-spa' | |
import NavigationBar from '../components/NavigationBar' | |
interface Props {} | |
const Page: NextPage<Props> = () => { | |
const { user } = useAuth0() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react' | |
import { NextPage } from 'next' | |
import { useAuth0 } from '../lib/auth0-spa' | |
import NavigationBar from '../components/NavigationBar' | |
import Link from 'next/link' | |
interface Props {} | |
const Page: NextPage<Props> = () => { | |
const { user } = useAuth0() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react' | |
import { NextPage } from 'next' | |
import { useAuth0 } from '../lib/auth0-spa' | |
import Link from 'next/link' | |
import NavigationBar from '../components/NavigationBar' | |
interface Props {} | |
const DashboardPage: NextPage<Props> = () => { | |
const { user } = useAuth0() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react' | |
import { NextPage } from 'next' | |
import { requireUser, useAuth0 } from '../lib/auth0-spa' | |
import Link from 'next/link' | |
import NavigationBar from '../components/NavigationBar' | |
interface Props {} | |
const DashboardPage: NextPage<Props> = () => { | |
const { user } = useAuth0() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react' | |
import { NextPage } from 'next' | |
interface Props {} | |
const Auth0CallbackPage: NextPage<Props> = () => null | |
export default Auth0CallbackPage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener('fetch', event => { | |
event.respondWith(new Response('Hello Worker')) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getAssetFromKV, mapRequestToAsset } from '@cloudflare/kv-asset-handler' | |
/** | |
* The DEBUG flag will do two things that help during development: | |
* 1. we will skip caching on the edge, which makes it easier to | |
* debug. | |
* 2. we will return an error message on exception in your Response rather | |
* than the default 404.html page. | |
*/ | |
const DEBUG = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getAssetFromKV, mapRequestToAsset } from '@cloudflare/kv-asset-handler' | |
const DEBUG = false | |
addEventListener('fetch', event => { | |
try { | |
event.respondWith(handleEvent(event)) | |
} catch (e) { | |
if (DEBUG) { | |
return event.respondWith( |