Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
feat: enable Github auth and add to script
Browse files Browse the repository at this point in the history
  • Loading branch information
hetd54 committed Sep 6, 2024
1 parent 17503fe commit 45af37b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
11 changes: 11 additions & 0 deletions auth.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import GitHub from "@auth/core/providers/github"
import { defineConfig } from "auth-astro"

export default defineConfig({
providers: [
GitHub({
clientId: import.meta.env.GITHUB_CLIENT_ID,
clientSecret: import.meta.env.GITHUB_CLIENT_SECRET,
}),
],
})
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
5 changes: 4 additions & 1 deletion public/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
</head>
<body>
<!-- Include the script that builds the page and powers Static CMS -->
<script src="https://unpkg.com/@staticcms/app@^4.0.0/dist/static-cms-app.js"></script>
<script src="https://unpkg.com/@staticcms/app@^4.0.0/dist/static-cms-app.js">
const { signIn } = await import("auth-astro/client")
document.querySelector(".CMS_Login_button").onclick = () => signIn("github")
</script>
<script type="module" src="/admin/config.js"></script>
</body>
</html>

0 comments on commit 45af37b

Please sign in to comment.