-
Notifications
You must be signed in to change notification settings - Fork 0
fix: live admin page authenticates with github #87
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs a few changes maybe? I'm still trying to wrap my head around this
api/_lib/oauth2.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably move this code into the src
directory. I think this folder was left over from the next template
output: "hybrid", | ||
integrations: [mdx(), sitemap(), tailwind(), react()], | ||
adapter: node({ | ||
mode: "standalone" | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably why firebase is upset
api/_lib/oauth2.ts
Outdated
<script> | ||
const receiveMessage = (message) => { | ||
window.opener.postMessage( | ||
'authorization:github:${status}:${JSON.stringify(content)}', | ||
message.origin | ||
); | ||
|
||
window.removeEventListener("message", receiveMessage, false); | ||
} | ||
window.addEventListener("message", receiveMessage, false); | ||
|
||
window.opener.postMessage("authorizing:github", "*"); | ||
</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to go in the auth.astro
page
@@ -14,6 +14,7 @@ | |||
"dependencies": { | |||
"@astrojs/check": "^0.5.3", | |||
"@astrojs/mdx": "^2.1.1", | |||
"@astrojs/node": "^8.3.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What did you need node for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Astro requires an ssr adapter in order to enable server side rendering : https://docs.astro.build/en/guides/server-side-rendering
src/pages/api/auth.astro
Outdated
|
||
<Layout title="Authenticate" description="" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this if the thing is calling GET
?
Visit the preview URL for this PR (updated for commit 8aca097): https://mmp-site-b1c9b--pr87-github-oauth-2s9273qa.web.app (expires Wed, 23 Oct 2024 21:13:06 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 4eb870c89e876f1812e204af417359065d2a23b1 |
No description provided.