Skip to content

Instantly share code, notes, and snippets.

@ProfAvery
Created November 28, 2022 22:06
Show Gist options
  • Save ProfAvery/c16f39768c6bcf7aa58ce9fc09564a61 to your computer and use it in GitHub Desktop.
Save ProfAvery/c16f39768c6bcf7aa58ce9fc09564a61 to your computer and use it in GitHub Desktop.
CPSC 349 - Files for Fall 2022 Exercise 4
const USERNAME = 'ADMIN_EMAIL'
const PASSWORD = 'ADMIN_PASSWORD'
const pb = new PocketBase('http://127.0.0.1:8090')
const authData = await pb.admins.authWithPassword(USERNAME, PASSWORD)
console.log(authData)
const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
)
function App () {
return (
<div className='App'>
<h1>Hello, {authData.admin.email}</h1>
</div>
)
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>CPSC 349 - Exercise 4</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="app.js"></script>
</head>
<body>
<div id="root"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment