Skip to content

Commit

Permalink
Merge pull request #17 from Leanstix/master
Browse files Browse the repository at this point in the history
authentication
  • Loading branch information
Leanstix authored Sep 10, 2024
2 parents 5ec084a + 4463aa9 commit d5b169a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/login/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,15 @@ export default function Login() {
const authenticateWithToken = async (tokenData) => {
setLoading(true);
try {
// Replace with actual logic to validate the tokenData (e.g., making a request to the server)
// Use the token directly for authentication
const res = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
secret_key: process.env.NEXT_PUBLIC_SECRET_KEY,
Authorization: `Bearer ${tokenData.token}`, // Pass the token in the Authorization header
},
body: JSON.stringify({
token: tokenData.token,
device_token: crypto.randomUUID(),
}),
});
Expand Down Expand Up @@ -77,7 +76,7 @@ export default function Login() {
<ApplicationLogo />
<div className="pt-11 w-full flex flex-col">
<p className="font-medium text-lg text-tremor-content-grayText pb-4">
Verifying
Verifying...
</p>
</div>
</div>
Expand Down

0 comments on commit d5b169a

Please sign in to comment.