{"id":15649886,"url":"https://github.com/theotterlord/starlight-auth","last_synced_at":"2025-04-14T02:52:34.753Z","repository":{"id":232692118,"uuid":"784888813","full_name":"TheOtterlord/starlight-auth","owner":"TheOtterlord","description":"Starlight + Auth.js template","archived":false,"fork":false,"pushed_at":"2024-05-20T19:19:16.000Z","size":349,"stargazers_count":47,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T16:55:55.552Z","etag":null,"topics":["astro","authjs","starlight"],"latest_commit_sha":null,"homepage":"https://starlight-auth-development.vercel.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheOtterlord.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-10T19:00:33.000Z","updated_at":"2025-03-25T16:31:41.000Z","dependencies_parsed_at":"2024-10-03T12:32:40.834Z","dependency_job_id":"39d87a3f-c032-49f1-82cb-46283f731dcc","html_url":"https://github.com/TheOtterlord/starlight-auth","commit_stats":null,"previous_names":["theotterlord/starlight-auth"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheOtterlord%2Fstarlight-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheOtterlord%2Fstarlight-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheOtterlord%2Fstarlight-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheOtterlord%2Fstarlight-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheOtterlord","download_url":"https://codeload.github.com/TheOtterlord/starlight-auth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813827,"owners_count":21165631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astro","authjs","starlight"],"created_at":"2024-10-03T12:32:25.073Z","updated_at":"2025-04-14T02:52:34.733Z","avatar_url":"https://github.com/TheOtterlord.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Starlight Starter Kit: Auth\n\n[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)\n\n```\nnpm create astro@latest -- --template TheOtterlord/starlight-auth\n```\n\n[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/TheOtterlord/starlight-auth/tree/main/examples/basics)\n[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/TheOtterlord/starlight-auth/tree/main/examples/basics)\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FTheOtterlord%2Fstarlight-auth%2Ftree%2Fmain%2Fexamples%2Fbasics\u0026project-name=my-starlight-docs\u0026repository-name=my-starlight-docs)\n\n## Setting up Auth\n\n\u003c!-- Authentication is configured in `auth.config.js`, and handled in `src/server/index.ts` for node deployments, or `middleware.js` for Vercel(/Netlify). Any on-demand `.astro` page may also access the session, like seen in `index.astro`. --\u003e\n\n### Authentication\n\nYou can customize the available sign-in methods in `auth.config.js`. [Auth.js](https://authjs.dev) supports [e-mail signin](https://authjs.dev/getting-started/authentication/email), traditional [username/password](https://authjs.dev/getting-started/authentication/credentials) auth, and 80+ [OAuth](https://authjs.dev/getting-started/authentication/oauth) providers. This template uses GitHub OAuth as an example.\n\n### Authorization\n\nBy default, any authenticated user will be authorized to view your gated content. You can add additional authorization checks to the `isAuthed` function in `src/lib/auth.ts`. If the function returns `true`, a user it authorized to access the page, and vice-versa if `false` is returned. The example logic restricts access to routes defined in `paths` above the `isAuthed` function.\n\n### Environment Variables\n\nYou may require different environment variables depending on your authentication method(s). Follow the example given in `.env.example` to create your `.env` file, replacing the `GITHUB` variables with the variables for your auth provider.\n\n## Deploy\n\nIn `astro.config.ts`, comment out the `adapter` for the platform you want to deploy to, removing the others. Deploy to your preferred provider, adding the environment variables you've defined.\n\n## Want to learn more?\n\nCheck out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheotterlord%2Fstarlight-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheotterlord%2Fstarlight-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheotterlord%2Fstarlight-auth/lists"}