Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-service-side-access-for-local
Browse files Browse the repository at this point in the history
  • Loading branch information
zoey-kaiser authored Sep 5, 2024
2 parents 44e9949 + 3a5fc50 commit 11b3dfc
Show file tree
Hide file tree
Showing 9 changed files with 142 additions and 726 deletions.
2 changes: 1 addition & 1 deletion docs/.vitepress/routes/navbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const routes: DefaultTheme.Config['nav'] = [
],
},
{
text: '0.9.0',
text: '0.9.1',
items: [
{
text: '0.8.2',
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/authjs/custom-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ definePageMeta({
})
const route = useRoute()
const erorCode = computed(() => route.params.error)
const errorCode = computed(() => route.query.error)
</script>
<template>
Expand Down
17 changes: 17 additions & 0 deletions docs/guide/authjs/nuxt-auth-handler.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@ The providers are the registered authentication methods that your users can use

You can find an overview of all the prebuilt providers [here](https://next-auth.js.org/providers/). If you want to create your own provider, please visit the [NextAuth docs](https://next-auth.js.org/configuration/providers/oauth#using-a-custom-provider).

::: warning
`next-auth@4` providers require an additional `.default` to work in Vite. This will no longer be necessary in `next-auth@5` (`authjs`).

```ts
import GithubProvider from 'next-auth/providers/github'

export default NuxtAuthHandler({
providers: [
// @ts-expect-error You need to use .default here for it to work during SSR. May be fixed via Vite at some point
GithubProvider.default({ // [!code focus]
// GitHub provider configuration
})
]
})
```
:::

## Callbacks

The callbacks inside the NuxtAuthHandler are asynchronous functions that allow you to hook into and modify the authentication flow. This is helpful for when you need to:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sidebase/nuxt-auth",
"version": "0.9.0",
"version": "0.9.1",
"license": "MIT",
"type": "module",
"description": "Authentication built for Nuxt 3! Easily add authentication via OAuth providers, credentials or Email Magic URLs!",
Expand Down Expand Up @@ -50,7 +50,7 @@
},
"devDependencies": {
"@antfu/eslint-config": "^2.25.0",
"@nuxt/module-builder": "^0.5.5",
"@nuxt/module-builder": "^0.8.3",
"@nuxt/schema": "^3.12.4",
"@nuxtjs/eslint-config-typescript": "^12.1.0",
"@types/node": "^18.19.42",
Expand Down
Loading

0 comments on commit 11b3dfc

Please sign in to comment.