-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Follow digial ocean guide for tokens
- Loading branch information
Showing
6 changed files
with
94 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from "react"; | ||
|
||
export default function Dashboard() { | ||
return <h2>Dashboard</h2>; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from "react"; | ||
|
||
export default function Preferences() { | ||
return <h2>Preferences</h2>; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import React, { useState } from "react"; | ||
import PocketBase from "pocketbase"; | ||
|
||
import PropTypes from "prop-types"; | ||
// const client = new PocketBase("http://localhost:8090"); | ||
|
||
// const userData = client.Users.authViaEmail("[email protected]", "12345678"); | ||
// console.log(userData); | ||
|
||
export default function Auth() { | ||
export default function Auth({ setToken }) { | ||
const [username, setUserName] = useState(); | ||
const [password, setPassword] = useState(); | ||
|
||
|
@@ -15,6 +15,7 @@ export default function Auth() { | |
e.preventDefault(); | ||
const userData = await client.Users.authViaEmail(username, password); | ||
console.log(userData); | ||
setToken(userData.token); | ||
}; | ||
return ( | ||
<div className="login-wrapper"> | ||
|
@@ -38,3 +39,7 @@ export default function Auth() { | |
</div> | ||
); | ||
} | ||
|
||
Auth.propTypes = { | ||
setToken: PropTypes.func.isRequired, | ||
}; |