Skip to content

Commit

Permalink
chore: move api to src
Browse files Browse the repository at this point in the history
  • Loading branch information
hetd54 committed Aug 26, 2024
1 parent aaf2feb commit ef8e69b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 0 additions & 2 deletions public/admin/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
local_backend: true

backend:
name: github
repo: brown-ccv/mmp
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions src/pages/api/auth.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ import Layout from "../../layouts/Layout.astro"
import { GET } from "./auth"
const auth = await GET(Astro.url.origin)
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", "*")
---

<Layout title="Authenticate" description="" />
2 changes: 1 addition & 1 deletion src/pages/api/auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import crypto from "crypto"
import { create } from "../../../api/_lib/oauth2.ts"
import { create } from "../../api/_lib/oauth2.ts"

export const prerender = false

Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/callback.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { create, renderBody } from "../../../api/_lib/oauth2.ts"
import { create, renderBody } from "../../api/_lib/oauth2.ts"

export const prerender = false

Expand Down

0 comments on commit ef8e69b

Please sign in to comment.