Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
811ed35
Updated to Antfu Eslint and auto-fixed all errors
zoey-kaiser Aug 9, 2024
f22571e
fix: docs linting issues
zoey-kaiser Aug 9, 2024
75da8df
disable eslint on custom sign-in page
zoey-kaiser Aug 9, 2024
0c36d6f
Installed OXLint
zoey-kaiser Aug 9, 2024
ff1ccda
fix: resolve oxlint errors
zoey-kaiser Aug 9, 2024
cca3714
fix: a majority of other lint issues
zoey-kaiser Aug 9, 2024
bbefb5e
fix: issues in local useAuth
zoey-kaiser Aug 9, 2024
c325798
fix: remaining lint issues
zoey-kaiser Aug 9, 2024
e1e9ab0
re-enabled linting for markdown files and fix issues in doc files
zoey-kaiser Aug 9, 2024
edd923e
fix: typecheck issue
zoey-kaiser Aug 9, 2024
e4ee174
fix: import RefreshHandler type correctly
zoey-kaiser Aug 9, 2024
14ea883
Merge branch 'main' into chore/update-eslint
zoey-kaiser Aug 17, 2024
25b2c1f
Merge branch 'main' into chore/update-eslint
zoey-kaiser Aug 17, 2024
0151ff8
Merge main
zoey-kaiser Aug 17, 2024
1670848
Merge branch 'chore/update-eslint' of github.com:sidebase/nuxt-auth i…
zoey-kaiser Aug 17, 2024
9c81621
fix: lint new files
zoey-kaiser Aug 17, 2024
5169d11
Merge branch 'main' into chore/update-eslint
zoey-kaiser Aug 20, 2024
1656623
Merge branch 'main' into chore/update-eslint
zoey-kaiser Aug 20, 2024
ed65ece
regenerated lockfile
zoey-kaiser Aug 20, 2024
3b251b1
auto fixed all linting issues
zoey-kaiser Aug 20, 2024
a33e96b
manuelly fixed remaining issues
zoey-kaiser Aug 20, 2024
72c4c85
Merge branch 'chore/update-eslint' of github.com:sidebase/nuxt-auth i…
zoey-kaiser Aug 20, 2024
cba80f0
Merge remote-tracking branch 'origin/main' into chore/update-eslint
phoenix-ru Aug 22, 2024
145ad16
chore: fix lints
phoenix-ru Aug 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .editorconfig

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

25 changes: 0 additions & 25 deletions .eslintrc

This file was deleted.

12 changes: 6 additions & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ Before posting an enchantment, please consider the following questions:
- Would it require a major, minor, or patch release?
- Which providers would be impacted by this change?

> [!IMPORTANT]
> [!IMPORTANT]
> The more impact your Enchantment has on the package, the longer it may take to push, as we need to integrate it into our release cycle.

> [!IMPORTANT]
> [!IMPORTANT]
> While we appreciate every request, we cannot accept them all. Please be understanding if we do not accept your request.

## Pull requests
Expand Down Expand Up @@ -94,10 +94,10 @@ To start developing on this package, please follow the quick start guide below.
```
8. [Open a Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests), and fill out the provided fields.

> [!TIP]
> [!TIP]
> Read more about how to use the included playground [here](../README.md#development).

> [!IMPORTANT]
> [!IMPORTANT]
> By submitting a Pull request, you agree to license your work under the MIT license used by the project.

### Reviews
Expand All @@ -106,7 +106,7 @@ After you submit your Pull request, a member of our core team will review it. Pl

After receiving a review, please address any comments left by the reviewer or debate them if you disagree. This process will repeat until the pull request is approved and merged!

> [!NOTE]
> [!NOTE]
> Besides a manual review of your pull request, we will run an automated CI pipeline on your code.

## Release cycles
Expand All @@ -119,7 +119,7 @@ This package follows [Semantic Versioning 2.0.0](https://semver.org/).

If we release a pre-version of a new release, we will tag it with `next` in the npmjs release and add one of the following additions to the versions:

- **ALPHA**: Early development build of a new release
- **ALPHA**: Early development build of a new release
- Not properly tested yet
- **RC**: Potential release candidate of a new release
- Internally tested on a series of demo apps
Expand Down
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

### πŸ“š Description


### πŸ“ Checklist

- [ ] I have linked an issue or discussion.
Expand Down
4 changes: 2 additions & 2 deletions .github/reproduire/needs-reproduction.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Hello πŸ‘‹

Please provide a [reproduction](https://nuxt.com/docs/community/reporting-bugs/#create-a-minimal-reproduction) for this issue πŸ™
Please provide a [reproduction](https://nuxt.com/docs/community/reporting-bugs/#create-a-minimal-reproduction) for this issue πŸ™

<details>
<summary>How can I create a reproduction?</summary>

Please use one of the following links to reproduce your issue.
Please use one of the following links to reproduce your issue.

- https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz
- https://codesandbox.io/s/github/nuxt/starter/v3-codesandbox
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ npx nuxi@latest module add sidebase-auth

<details>
<summary>Or install manually</summary>

#### 1. Install the package as a dev dependency

```sh
Expand All @@ -53,7 +53,7 @@ npx nuxi@latest module add sidebase-auth

```ts
export default defineNuxtConfig({
modules: ['@sidebase/nuxt-auth']
modules: ['@sidebase/nuxt-auth']
})
```
</details>
Expand All @@ -80,7 +80,7 @@ You can find a full list of our features, as well as which provider supports eac
- Methods to `getSession`, `getCsrfToken`, `getProviders`, `signIn` and `signOut`
- Full TypeScript support for all methods and properties

### Application protection
### Application protection
- Application-side middleware protection for the [full application](https://auth.sidebase.io/guide/application-side/protecting-pages#global-middleware) or [specific pages](https://auth.sidebase.io/guide/application-side/protecting-pages#local-middleware)
- Server-side [middleware](https://auth.sidebase.io/guide/authjs/server-side/session-access#server-middleware) and [endpoint protection](https://auth.sidebase.io/guide/authjs/server-side/session-access#endpoint-protection)

Expand Down Expand Up @@ -162,10 +162,10 @@ To test static Nuxt 3 apps we want to run a static frontend and a separate backe

pnpm dev

# A second Nuxt app should now be running on http://localhost:3001.
# A second Nuxt app should now be running on http://localhost:3001.
# We use this purely for authentication
```
4. Visit [http://localhost:3000](http://localhost:3000) -> this should open the static application. Performing any auth-related actions, the app should send requests to the backend running on port `3001`
4. Visit [http://localhost:3000](http://localhost:3000) -> this should open the static application. Performing any auth-related actions, the app should send requests to the backend running on port `3001`

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default defineConfig({
},
editLink: {
pattern: 'https://github.com/sidebase/nuxt-auth/tree/main/docs/:path',
text: 'Edit this page on GitHub'
}
text: 'Edit this page on GitHub',
},
},
})
4 changes: 2 additions & 2 deletions docs/.vitepress/head.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { HeadConfig } from "vitepress"
import type { HeadConfig } from 'vitepress'

const HOST_NAME = 'https://auth.sidebase.io'
const OG_IMAGE_URL = `${HOST_NAME}/nuxt-auth-og.jpg`

export const sitemapConfig = {
hostname: HOST_NAME
hostname: HOST_NAME,
}

export const headConfig: HeadConfig[] = [
Expand Down
6 changes: 3 additions & 3 deletions docs/.vitepress/theme/components/Banner.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts" setup>
import { VPButton } from 'vitepress/theme';
import { VPButton } from 'vitepress/theme'

defineProps<{
text?: string,
text?: string
button?: {
href: string,
href: string
text: string
}
}>()
Expand Down
50 changes: 25 additions & 25 deletions docs/.vitepress/theme/components/GithubStarsButton.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import StarIcon from './StarIcon.vue';
import { onMounted, ref } from 'vue'
import StarIcon from './StarIcon.vue'

const props = defineProps<{
owner: string,
owner: string
repo: string
}>()

const count = ref(0)

async function fetchCount () {
async function fetchCount() {
const res = await fetch(`https://api.github.com/repos/${props.owner}/${props.repo}`)
const resJson = await res.json()
count.value = resJson.stargazers_count ?? 0
Expand All @@ -18,27 +18,27 @@ onMounted(fetchCount)
</script>

<template>
<div class="Wrapper">
<a
title="Github"
class="Button"
:href="`https://github.com/${owner}/${repo}`"
target="_blank"
rel="noreferrer noopener"
>
<StarIcon />
Star
</a>
<a
class="Count"
:href="`https://github.com/${owner}/${repo}/stargazers`"
aria-label={label}
target="_blank"
rel="noreferrer noopener"
>
{{ new Intl.NumberFormat().format(count) }}
</a>
</div>
<div class="Wrapper">
<a
title="Github"
class="Button"
:href="`https://github.com/${owner}/${repo}`"
target="_blank"
rel="noreferrer noopener"
>
<StarIcon />
Star
</a>
<a
class="Count"
:href="`https://github.com/${owner}/${repo}/stargazers`"
aria-label="{label}"
target="_blank"
rel="noreferrer noopener"
>
{{ new Intl.NumberFormat().format(count) }}
</a>
</div>
</template>

<style scoped>
Expand Down
4 changes: 2 additions & 2 deletions docs/.vitepress/theme/components/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const bannerConfig = {
text: '✨ NuxtAuth v0.8.0 has been released! ✨',
button: {
href: 'https://github.com/sidebase/nuxt-auth/releases/tag/0.8.0',
text: 'View release notes'
}
text: 'View release notes',
},
}
</script>

Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/components/RecipeHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ withDefaults(defineProps<{
</div>
<a v-if="author" class="Avatar" :href="`https://github.com/${author}`" target="_blank" rel="noreferrer noopener">
<span>{{ author }}</span>
<img :src="`https://github.com/${author}.png?size=100`" />
<img :src="`https://github.com/${author}.png?size=100`">
</a>
</div>
<hr>
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/components/Tag.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
type BadgeType = 'info' | 'tip' | 'warning' | 'danger' | 'authjs' | 'local' | 'refresh' | 'community' | 'official'
withDefaults(defineProps<{
text: string,
text: string
type?: BadgeType
}>(), { type: 'tip' })
</script>
Expand Down
64 changes: 32 additions & 32 deletions docs/guide/advanced/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ If only a few of your pages are cached. Head over to the [Nuxt config `routeRule

```ts
export default defineNuxtConfig({
modules: ['@sidebase/nuxt-auth'],
auth: {
// Optional - Needed for getProviders() method to work server-side
baseURL: 'http://localhost:3000',
},
routeRules: {
'/': {
swr: 86400000,
auth: {
disableServerSideAuth: true,
},
},
modules: ['@sidebase/nuxt-auth'],
auth: {
// Optional - Needed for getProviders() method to work server-side
baseURL: 'http://localhost:3000',
},
routeRules: {
'/': {
swr: 86400000,
auth: {
disableServerSideAuth: true,
},
},
},
})
```

Expand All @@ -42,12 +42,12 @@ If all/most pages on your site are cached. Head over to the Nuxt config, add the

```ts
export default defineNuxtConfig({
modules: ['@sidebase/nuxt-auth'],
auth: {
disableServerSideAuth: true,
// Optional - Needed for getProviders() method to work server-side
baseURL: 'http://localhost:3000',
},
modules: ['@sidebase/nuxt-auth'],
auth: {
disableServerSideAuth: true,
// Optional - Needed for getProviders() method to work server-side
baseURL: 'http://localhost:3000',
},
})
```

Expand All @@ -59,21 +59,21 @@ For example: It may be ideal to add caching to every page besides your profile p

```ts
export default defineNuxtConfig({
modules: ['@sidebase/nuxt-auth'],
auth: {
disableServerSideAuth: true,
modules: ['@sidebase/nuxt-auth'],
auth: {
disableServerSideAuth: true,
},
routeRules: {
// Server side auth is disabled on this page because of global setting
'/': {
swr: 86400000,
},
routeRules: {
// Server side auth is disabled on this page because of global setting
'/': {
swr: 86400000,
}
// Server side auth is enabled on this page - route rules takes priority.
'/profile': {
auth: {
disableServerSideAuth: false,
},
},
// Server side auth is enabled on this page - route rules takes priority.
'/profile': {
auth: {
disableServerSideAuth: false,
},
},
},
})
```
9 changes: 4 additions & 5 deletions docs/guide/advanced/deployment/netlify.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ These variables are avalible at build-time. Therefore you can references this va

```ts
export default defineNuxtConfig({
modules: ['@sidebase/nuxt-auth'],
auth: {
baseURL: process.env.DEPLOY_URL ? `${DEPLOY_URL}/api/auth` : undefined
}
modules: ['@sidebase/nuxt-auth'],
auth: {
baseURL: process.env.DEPLOY_URL ? `${DEPLOY_URL}/api/auth` : undefined
}
})
```

At build time this will check if your application is running inside a Netlify environment (using `process.env.DEPLOY_URL` or `process.env.URL`). If this environment variable is set the `baseURL` is infered by combining the `host` and `path` together.


::: warning
Securing a preview deployment (with an OAuth provider) comes with some critical obstacles. Most OAuth providers only allow a single redirect/callback URL, or at least a set of full static URLs. Meaning you cannot set the value before publishing the site and you cannot use wildcard subdomains in the callback URL settings of your OAuth provider. To avoid this, AuthJS has a few suggestions you can find [here](https://next-auth.js.org/deployment#securing-a-preview-deployment).
:::
Loading