-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from odu-emse/ALMP-314
Almp 314
- Loading branch information
Showing
9 changed files
with
11,624 additions
and
17,462 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
swcMinify: true, | ||
images: { | ||
domains: [ | ||
"images.unsplash.com" | ||
] | ||
} | ||
} | ||
reactStrictMode: true, | ||
swcMinify: true, | ||
images: { | ||
domains: ['images.unsplash.com', 'lh3.googleusercontent.com'], | ||
}, | ||
}; | ||
|
||
module.exports = nextConfig | ||
module.exports = nextConfig; |
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,24 +1,20 @@ | ||
import { OAuth2Client } from "google-auth-library"; | ||
import { OAuth2Client } from 'google-auth-library'; | ||
|
||
export default async function handler(req, res) { | ||
const token = req.cookies?.auth; | ||
if (token === undefined) { | ||
res.status(401).send('Unauthorized'); | ||
return; | ||
} | ||
|
||
const token = req.cookies?.auth; | ||
if (token === undefined) { | ||
res.status(401).send("Unauthorized"); | ||
return; | ||
} | ||
|
||
const client = new OAuth2Client(process.env.GOOGLE_ID); | ||
try { | ||
await client.verifyIdToken({ | ||
idToken: token, | ||
audience: process.env.GOOGLE_ID, | ||
}); | ||
} catch(e) { | ||
res.status(401).send("Unauthorized"); | ||
return; | ||
} | ||
|
||
res.status(200).send("OK"); | ||
const client = new OAuth2Client(process.env.GOOGLE_ID); | ||
try { | ||
const response = await client.verifyIdToken({ | ||
idToken: token, | ||
audience: process.env.GOOGLE_ID, | ||
}); | ||
res.status(200).json(response); | ||
} catch (e) { | ||
res.status(401).send('Unauthorized'); | ||
} | ||
} | ||
|
Oops, something went wrong.