-
-
Notifications
You must be signed in to change notification settings - Fork 179
docs: update documentation to 1.0.0-rc.1 #1029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
phoenix-ru
wants to merge
2
commits into
main
Choose a base branch
from
docs/update-to-rc-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Upgrade to 1.0.0-rc.1 | ||
|
||
> This is a pre-release. We encourage you to test it out and report all the issues you find with it. | ||
|
||
> This release contains breaking changes for `signIn` and `signUp` functions | ||
|
||
π We're excited to share that `@sidebase/nuxt-auth` is moving towards its 1.0 release! Read the [full roadmap here](https://github.com/sidebase/nuxt-auth/issues/1028). | ||
|
||
## Installation | ||
|
||
::: code-group | ||
|
||
```bash [npm] | ||
npm i -D @sidebase/nuxt-auth@^1.0.0-rc.1 | ||
``` | ||
|
||
```bash [pnpm] | ||
pnpm i -D @sidebase/nuxt-auth@^1.0.0-rc.1 | ||
``` | ||
|
||
```bash [yarn] | ||
yarn add --dev @sidebase/nuxt-auth@^1.0.0-rc.1 | ||
``` | ||
|
||
::: | ||
|
||
## :warning: Breaking changes | ||
|
||
### `signUp` function in `local` provider | ||
There's a breaking change in `local` provider `signUp` function which now only accepts 2 parameters. This is due to `signUp` having an [extra parameter](https://github.com/sidebase/nuxt-auth/blob/4b3a5904c9e0d3bce6a6334bf4a463d4835d4a48/src/runtime/composables/local/useAuth.ts#L170) from its initial implementation. | ||
|
||
If you used `signUp` with three parameters, merge the third parameter into the second: | ||
```ts diff | ||
await signUp(credentials, { external: true }, { preventLoginFlow: true }) // [!code --] | ||
await signUp(credentials, { external: true, preventLoginFlow: true }) // [!code ++] | ||
|
||
await signUp(credentials, undefined, { preventLoginFlow: true }) // [!code --] | ||
await signUp(credentials, { preventLoginFlow: true }) // [!code ++] | ||
``` | ||
|
||
### `signIn` function in `authjs` provider | ||
This function now [always](https://github.com/sidebase/nuxt-auth/blob/07199b1ccf74577890cab224c2782c7f88a9a9b6/src/runtime/composables/authjs/useAuth.ts#L90) returns an object [`SignInResult`](https://github.com/sidebase/nuxt-auth/blob/07199b1ccf74577890cab224c2782c7f88a9a9b6/src/runtime/composables/authjs/useAuth.ts#L29-L34): | ||
|
||
```ts | ||
interface SignInResult { | ||
error: string | null | ||
status: number | ||
ok: boolean | ||
url: any | ||
} | ||
``` | ||
|
||
This was done to remove the previously missing `| void` from the signature, improving type-safety and usability. If you checked for `void` being returned, adjust your usage accordingly: | ||
|
||
```ts diff | ||
const signInResponse = await signIn(/* ... */) | ||
|
||
const isResponseDefined = signInResponse // [!code --] | ||
const isResponseDefined = signInResponse.error === null // [!code ++] | ||
|
||
if (isResponseDefined) { | ||
// ... | ||
} | ||
``` | ||
|
||
## Changelog | ||
|
||
* feat: return signin response if no redirection by @despatates in https://github.com/sidebase/nuxt-auth/pull/977 | ||
* Enh(#843): Allow signup flow return data when preventLoginFlow is true by @iamKiNG-Fr in https://github.com/sidebase/nuxt-auth/pull/903 | ||
* chore: display register error message by @DevDengChao in https://github.com/sidebase/nuxt-auth/pull/1015 | ||
* bump dependencies by @phoenix-ru in https://github.com/sidebase/nuxt-auth/pull/1016 | ||
* chore: refactor useAuth composables to encapsulate context by @phoenix-ru in https://github.com/sidebase/nuxt-auth/pull/1024 | ||
|
||
**Full Changelog**: https://github.com/sidebase/nuxt-auth/compare/0.10.1...v1.0.0-rc.1 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend we pin the version, as its still in RC. What do you think?