Compare commits
137 Commits
@nhost/rea
...
@nhost/cor
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f81ba9713 | ||
|
|
2f815e5eb6 | ||
|
|
2cabd2d29a | ||
|
|
d4ee6cc756 | ||
|
|
8208b1c385 | ||
|
|
4c6c094f71 | ||
|
|
3dadc7eab9 | ||
|
|
784041020b | ||
|
|
74758f2c36 | ||
|
|
ea34a3856b | ||
|
|
c9175b76d3 | ||
|
|
1c82522163 | ||
|
|
5794357374 | ||
|
|
3edf41f989 | ||
|
|
44f069a253 | ||
|
|
cb0988cb87 | ||
|
|
27752ca8a7 | ||
|
|
855181abbc | ||
|
|
bc0515bd59 | ||
|
|
271c401b1a | ||
|
|
cbed7cdc72 | ||
|
|
fca620f050 | ||
|
|
5200a4f272 | ||
|
|
19458cf076 | ||
|
|
1a94359a81 | ||
|
|
96001f683a | ||
|
|
dd08453fb5 | ||
|
|
739a3c4563 | ||
|
|
20f3eb9086 | ||
|
|
7b5f8647fb | ||
|
|
486ddec751 | ||
|
|
6475047158 | ||
|
|
14b26bdbc7 | ||
|
|
8e4d790b04 | ||
|
|
d814c7b46b | ||
|
|
5baeddba0b | ||
|
|
0262723329 | ||
|
|
1cf8a58d2c | ||
|
|
b9a19d8251 | ||
|
|
465d248456 | ||
|
|
9e4861f2bb | ||
|
|
4ca738ba56 | ||
|
|
be27ed73e1 | ||
|
|
f4d81d33b9 | ||
|
|
730c7d7b28 | ||
|
|
38de442a7f | ||
|
|
22b8f02504 | ||
|
|
79f268ea08 | ||
|
|
24825adb08 | ||
|
|
96e59f0251 | ||
|
|
9e43c320b9 | ||
|
|
f199ed5474 | ||
|
|
2f00d7f309 | ||
|
|
d35dfb1aa0 | ||
|
|
93f1d1944c | ||
|
|
efd3904966 | ||
|
|
133e682e91 | ||
|
|
72eebe538e | ||
|
|
af313212f7 | ||
|
|
06b29f14fc | ||
|
|
4b960227cf | ||
|
|
a9e2db678d | ||
|
|
4d0738d51c | ||
|
|
1a8160632e | ||
|
|
084ea77355 | ||
|
|
19e5abb4a9 | ||
|
|
fe6514fa14 | ||
|
|
92e9659cc7 | ||
|
|
d5a2a259ce | ||
|
|
6929c7f423 | ||
|
|
d5f56f7e18 | ||
|
|
6ddaf47a4b | ||
|
|
11200934a8 | ||
|
|
653f6b5766 | ||
|
|
653c886ec0 | ||
|
|
ecba8f78ac | ||
|
|
d7b5261f5a | ||
|
|
164e8cac28 | ||
|
|
ad0d56416c | ||
|
|
c47ba63dd9 | ||
|
|
47fb75302f | ||
|
|
2c95ed2d14 | ||
|
|
07eb26ca29 | ||
|
|
90843a9feb | ||
|
|
5e5a9d6efa | ||
|
|
5fc3b643a7 | ||
|
|
a365cadbd7 | ||
|
|
eb93a20bc0 | ||
|
|
ac2cd3f34e | ||
|
|
26cb0de087 | ||
|
|
6d93aa4235 | ||
|
|
8221664f61 | ||
|
|
9396bdbbe3 | ||
|
|
63fd6abd54 | ||
|
|
03d7083d3e | ||
|
|
618e5a8db2 | ||
|
|
3a217fd490 | ||
|
|
4e30b4ee21 | ||
|
|
9eb78e06db | ||
|
|
3d7369a19e | ||
|
|
8e03774bc1 | ||
|
|
13937fa026 | ||
|
|
9e57a2bfe6 | ||
|
|
b07a61b8e4 | ||
|
|
f52336f698 | ||
|
|
bf4cc38f8d | ||
|
|
4e7d1fbe90 | ||
|
|
5ff6876aea | ||
|
|
d392ed86fb | ||
|
|
2d6e95b8b5 | ||
|
|
3bbe09c4b1 | ||
|
|
648c880445 | ||
|
|
c286a0bbb1 | ||
|
|
745d9a958d | ||
|
|
a47ce29173 | ||
|
|
8c12b4117b | ||
|
|
2f432b5c5f | ||
|
|
afcced2417 | ||
|
|
88fa68e74c | ||
|
|
47b4a3ecf1 | ||
|
|
9095a0f6ae | ||
|
|
4629b952c6 | ||
|
|
f6cfca9288 | ||
|
|
b9c012e263 | ||
|
|
0e112674a4 | ||
|
|
0feac15d10 | ||
|
|
f42b693aa2 | ||
|
|
9687581dc7 | ||
|
|
9bf938a507 | ||
|
|
06bc8856dd | ||
|
|
1c3c7c225f | ||
|
|
42fba7a095 | ||
|
|
0ff633760a | ||
|
|
6c51571182 | ||
|
|
3825a09aed | ||
|
|
1768b1e069 | ||
|
|
fba5c819ce |
17
README.md
17
README.md
@@ -383,14 +383,21 @@ Here are some ways of contributing to making Nhost better:
|
||||
<sub><b>Hoang Do</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/eltociear">
|
||||
<img src="https://avatars.githubusercontent.com/u/22633385?v=4" width="100;" alt="eltociear"/>
|
||||
<br />
|
||||
<sub><b>Ikko Ashimine</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/jladuval">
|
||||
<img src="https://avatars.githubusercontent.com/u/1935359?v=4" width="100;" alt="jladuval"/>
|
||||
<br />
|
||||
<sub><b>Jacob Duval</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/kylehayes">
|
||||
<img src="https://avatars.githubusercontent.com/u/509932?v=4" width="100;" alt="kylehayes"/>
|
||||
@@ -425,15 +432,15 @@ Here are some ways of contributing to making Nhost better:
|
||||
<br />
|
||||
<sub><b>Nacho Aldama</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/ghoshnirmalya">
|
||||
<img src="https://avatars.githubusercontent.com/u/6391763?v=4" width="100;" alt="ghoshnirmalya"/>
|
||||
<br />
|
||||
<sub><b>Nirmalya Ghosh</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/quentin-decre">
|
||||
<img src="https://avatars.githubusercontent.com/u/1137511?v=4" width="100;" alt="quentin-decre"/>
|
||||
|
||||
@@ -39,7 +39,7 @@ query {
|
||||
|
||||
Users should be created using the sign-up or sign-in flows as described under [sign-in methods](/platform/authentication/sign-in-methods).
|
||||
|
||||
- **Never** create users directly via GraphQL or database.
|
||||
- **Never** create users directly via GraphQL or database, unless you [import users](#import-users) from an external system.
|
||||
- **Never** modify the `auth.users` table.
|
||||
- **Never** modify the GraphQL root queries or fields for any of the tables in the `auth` schema.
|
||||
|
||||
@@ -136,3 +136,31 @@ await nhost.auth.signUp({
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## Import Users
|
||||
|
||||
If you have users in a different system, you can import them into Nhost. When importing users you should insert the users directly into the database instead of using the authentication endpoints (`/signup/email-password`).
|
||||
|
||||
It's possible to insert users via GraphQL or SQL.
|
||||
|
||||
### GraphQL
|
||||
|
||||
Make a GraphQL request to insert a user like this:
|
||||
|
||||
```graphql
|
||||
mutation insertUser($user: users_insert_input!) {
|
||||
insertUser(object: $user) {
|
||||
id
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### SQL
|
||||
|
||||
Connect directly to the database and insert a user like this:
|
||||
|
||||
```sql
|
||||
INSERT INTO auth.users (id, email, display_name, password_hash, ..) VALUES ('<user-id>', '<email>', '<display-name>', '<password-hash>', ..);
|
||||
```
|
||||
|
||||
User passwords are hashed using [bcrypt](https://en.wikipedia.org/wiki/Bcrypt) in Nhost.
|
||||
|
||||
@@ -3,7 +3,7 @@ title: 'init'
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
Intialize a local Nhost project in the current working directory.
|
||||
Initialize a local Nhost project in the current working directory.
|
||||
|
||||
```
|
||||
nhost init
|
||||
|
||||
@@ -4,7 +4,7 @@ title: signUp()
|
||||
sidebar_label: signUp()
|
||||
slug: /reference/javascript/auth/sign-up
|
||||
description: Use `nhost.auth.signUp` to sign up a user using email and password. If you want to sign up a user using passwordless email (Magic Link), SMS, or an OAuth provider, use the `signIn` function instead.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L103
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L107
|
||||
---
|
||||
|
||||
# `signUp()`
|
||||
@@ -22,12 +22,6 @@ nhost.auth.signUp({
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`SignUpEmailPasswordParams`](/reference/docgen/javascript/auth/types/sign-up-email-password-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :------------------------------------------------------------------------------------------------------- | :-------------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>password</span> | `string` | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>email</span> | `string` | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>options</span> | `SignUpOptions` | | |
|
||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`SignUpParams`](/reference/docgen/javascript/auth/types/sign-up-params)
|
||||
|
||||
---
|
||||
|
||||
@@ -4,7 +4,7 @@ title: signIn()
|
||||
sidebar_label: signIn()
|
||||
slug: /reference/javascript/auth/sign-in
|
||||
description: Use `nhost.auth.signIn` to sign in a user using email and password, passwordless (email or sms) or an external provider. `signIn` can be used to sign in a user in various ways depending on the parameters.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L146
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L156
|
||||
---
|
||||
|
||||
# `signIn()`
|
||||
|
||||
@@ -4,7 +4,7 @@ title: signOut()
|
||||
sidebar_label: signOut()
|
||||
slug: /reference/javascript/auth/sign-out
|
||||
description: Use `nhost.auth.signOut` to sign out the user.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L231
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L252
|
||||
---
|
||||
|
||||
# `signOut()`
|
||||
|
||||
@@ -4,7 +4,7 @@ title: resetPassword()
|
||||
sidebar_label: resetPassword()
|
||||
slug: /reference/javascript/auth/reset-password
|
||||
description: Use `nhost.auth.resetPassword` to reset the password for a user. This will send a reset-password link in an email to the user. When the user clicks the reset-password link the user is automatically signed-in. Once signed-in, the user can change their password using `nhost.auth.changePassword()`.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L247
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L268
|
||||
---
|
||||
|
||||
# `resetPassword()`
|
||||
|
||||
@@ -4,7 +4,7 @@ title: changePassword()
|
||||
sidebar_label: changePassword()
|
||||
slug: /reference/javascript/auth/change-password
|
||||
description: Use `nhost.auth.changePassword` to change the password for the signed-in user. The old password is not needed. In case the user is not signed-in, a password reset ticket needs to be provided.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L263
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L284
|
||||
---
|
||||
|
||||
# `changePassword()`
|
||||
|
||||
@@ -4,7 +4,7 @@ title: sendVerificationEmail()
|
||||
sidebar_label: sendVerificationEmail()
|
||||
slug: /reference/javascript/auth/send-verification-email
|
||||
description: Use `nhost.auth.sendVerificationEmail` to send a verification email to the specified email. The email contains a verification-email link. When the user clicks the verification-email link their email is verified.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L279
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L303
|
||||
---
|
||||
|
||||
# `sendVerificationEmail()`
|
||||
|
||||
@@ -4,7 +4,7 @@ title: changeEmail()
|
||||
sidebar_label: changeEmail()
|
||||
slug: /reference/javascript/auth/change-email
|
||||
description: Use `nhost.auth.changeEmail` to change a user's email. This will send a confirm-email-change link in an email to the new email. Once the user clicks on the confirm-email-change link the email will be change to the new email.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L298
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L322
|
||||
---
|
||||
|
||||
# `changeEmail()`
|
||||
|
||||
@@ -4,7 +4,7 @@ title: deanonymize()
|
||||
sidebar_label: deanonymize()
|
||||
slug: /reference/javascript/auth/deanonymize
|
||||
description: Use `nhost.auth.deanonymize` to deanonymize a user.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L314
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L338
|
||||
---
|
||||
|
||||
# `deanonymize()`
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: addSecurityKey()
|
||||
sidebar_label: addSecurityKey()
|
||||
slug: /reference/javascript/auth/add-security-key
|
||||
description: Use `nhost.auth.addSecurityKey to add a security key to the user, using the WebAuthn API.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L376
|
||||
---
|
||||
|
||||
# `addSecurityKey()`
|
||||
|
||||
Use `nhost.auth.addSecurityKey to add a security key to the user, using the WebAuthn API.
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">nickname</span>** <span className="optional-status">optional</span> `string`
|
||||
|
||||
optional human-readable nickname for the security key
|
||||
|
||||
---
|
||||
@@ -4,7 +4,7 @@ title: onTokenChanged()
|
||||
sidebar_label: onTokenChanged()
|
||||
slug: /reference/javascript/auth/on-token-changed
|
||||
description: Use `nhost.auth.onTokenChanged` to add a custom function that runs every time the access or refresh token is changed.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L357
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L394
|
||||
---
|
||||
|
||||
# `onTokenChanged()`
|
||||
@@ -4,7 +4,7 @@ title: onAuthStateChanged()
|
||||
sidebar_label: onAuthStateChanged()
|
||||
slug: /reference/javascript/auth/on-auth-state-changed
|
||||
description: Use `nhost.auth.onAuthStateChanged` to add a custom function that runs every time the authentication status of the user changes. E.g. add a custom function that runs every time the authentication status changes from signed-in to signed-out.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L392
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L429
|
||||
---
|
||||
|
||||
# `onAuthStateChanged()`
|
||||
@@ -4,7 +4,7 @@ title: isAuthenticated()
|
||||
sidebar_label: isAuthenticated()
|
||||
slug: /reference/javascript/auth/is-authenticated
|
||||
description: Use `nhost.auth.isAuthenticated` to check if the user is authenticated or not.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L434
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L471
|
||||
---
|
||||
|
||||
# `isAuthenticated()`
|
||||
@@ -4,7 +4,7 @@ title: isAuthenticatedAsync()
|
||||
sidebar_label: isAuthenticatedAsync()
|
||||
slug: /reference/javascript/auth/is-authenticated-async
|
||||
description: Use `nhost.auth.isAuthenticatedAsync` to wait (await) for any internal authentication network requests to finish and then return the authentication status.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L452
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L489
|
||||
---
|
||||
|
||||
# `isAuthenticatedAsync()`
|
||||
@@ -4,7 +4,7 @@ title: getAuthenticationStatus()
|
||||
sidebar_label: getAuthenticationStatus()
|
||||
slug: /reference/javascript/auth/get-authentication-status
|
||||
description: Use `nhost.auth.getAuthenticationStatus` to get the authentication status of the user.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L478
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L515
|
||||
---
|
||||
|
||||
# `getAuthenticationStatus()`
|
||||
@@ -4,7 +4,7 @@ title: getAccessToken()
|
||||
sidebar_label: getAccessToken()
|
||||
slug: /reference/javascript/auth/get-access-token
|
||||
description: Use `nhost.auth.getAccessToken` to get the access token of the user.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L508
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L545
|
||||
---
|
||||
|
||||
# `getAccessToken()`
|
||||
@@ -4,7 +4,7 @@ title: getDecodedAccessToken()
|
||||
sidebar_label: getDecodedAccessToken()
|
||||
slug: /reference/javascript/auth/get-decoded-access-token
|
||||
description: Use `nhost.auth.getDecodedAccessToken` to get the decoded access token of the user.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L523
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L560
|
||||
---
|
||||
|
||||
# `getDecodedAccessToken()`
|
||||
@@ -4,7 +4,7 @@ title: getHasuraClaims()
|
||||
sidebar_label: getHasuraClaims()
|
||||
slug: /reference/javascript/auth/get-hasura-claims
|
||||
description: Use `nhost.auth.getHasuraClaims` to get the Hasura claims of the user.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L540
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L577
|
||||
---
|
||||
|
||||
# `getHasuraClaims()`
|
||||
@@ -4,7 +4,7 @@ title: getHasuraClaim()
|
||||
sidebar_label: getHasuraClaim()
|
||||
slug: /reference/javascript/auth/get-hasura-claim
|
||||
description: Use `nhost.auth.getHasuraClaim` to get the value of a specific Hasura claim of the user.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L558
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L595
|
||||
---
|
||||
|
||||
# `getHasuraClaim()`
|
||||
@@ -4,7 +4,7 @@ title: refreshSession()
|
||||
sidebar_label: refreshSession()
|
||||
slug: /reference/javascript/auth/refresh-session
|
||||
description: Use `nhost.auth.refreshSession` to refresh the session with either the current internal refresh token or an external refresh token.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L581
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L618
|
||||
---
|
||||
|
||||
# `refreshSession()`
|
||||
@@ -4,7 +4,7 @@ title: getSession()
|
||||
sidebar_label: getSession()
|
||||
slug: /reference/javascript/auth/get-session
|
||||
description: Use `nhost.auth.getSession()` to get the session of the user.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L625
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L659
|
||||
---
|
||||
|
||||
# `getSession()`
|
||||
@@ -4,7 +4,7 @@ title: getUser()
|
||||
sidebar_label: getUser()
|
||||
slug: /reference/javascript/auth/get-user
|
||||
description: Use `nhost.auth.getUser()` to get the signed-in user.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L640
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L674
|
||||
---
|
||||
|
||||
# `getUser()`
|
||||
@@ -4,7 +4,7 @@ title: HasuraAuthClient
|
||||
sidebar_label: Auth
|
||||
description: No description provided.
|
||||
slug: /reference/javascript/auth
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L60
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L64
|
||||
---
|
||||
|
||||
# `HasuraAuthClient`
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiChangeEmailResponse
|
||||
sidebar_label: ApiChangeEmailResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L182
|
||||
---
|
||||
|
||||
# `ApiChangeEmailResponse`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||
|
||||
---
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiChangePasswordResponse
|
||||
sidebar_label: ApiChangePasswordResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L174
|
||||
---
|
||||
|
||||
# `ApiChangePasswordResponse`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||
|
||||
---
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiDeanonymizeResponse
|
||||
sidebar_label: ApiDeanonymizeResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L186
|
||||
---
|
||||
|
||||
# `ApiDeanonymizeResponse`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||
|
||||
---
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiRefreshTokenResponse
|
||||
sidebar_label: ApiRefreshTokenResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L162
|
||||
---
|
||||
|
||||
# `ApiRefreshTokenResponse`
|
||||
|
||||
```ts
|
||||
type ApiRefreshTokenResponse =
|
||||
| { session: null; error: ErrorPayload }
|
||||
| { session: Session; error: null }
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiResetPasswordResponse
|
||||
sidebar_label: ApiResetPasswordResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L170
|
||||
---
|
||||
|
||||
# `ApiResetPasswordResponse`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||
|
||||
---
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiSendVerificationEmailResponse
|
||||
sidebar_label: ApiSendVerificationEmailResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L178
|
||||
---
|
||||
|
||||
# `ApiSendVerificationEmailResponse`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||
|
||||
---
|
||||
@@ -1,29 +0,0 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiSignInData
|
||||
sidebar_label: ApiSignInData
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L151
|
||||
---
|
||||
|
||||
# `ApiSignInData`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">session</span>** <span className="optional-status">required</span> [`Session`](/reference/docgen/javascript/auth/types/session)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">session.</span>user</span> | `null` \| [`User`](/reference/docgen/javascript/auth/types/user) | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">session.</span>refreshToken</span> | `string` | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">session.</span>accessTokenExpiresIn</span> | `number` | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">session.</span>accessToken</span> | `string` | ✔️ | |
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">mfa</span>** <span className="optional-status">required</span> `null` | [`Mfa`](/reference/docgen/javascript/auth/types/mfa)
|
||||
|
||||
---
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiSignInResponse
|
||||
sidebar_label: ApiSignInResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L155
|
||||
---
|
||||
|
||||
# `ApiSignInResponse`
|
||||
|
||||
```ts
|
||||
type ApiSignInResponse =
|
||||
| { data: ApiSignInData; error: null }
|
||||
| { data: null; error: ErrorPayload }
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiSignOutResponse
|
||||
sidebar_label: ApiSignOutResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L166
|
||||
---
|
||||
|
||||
# `ApiSignOutResponse`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||
|
||||
---
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiSignUpEmailPasswordResponse
|
||||
sidebar_label: ApiSignUpEmailPasswordResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L147
|
||||
---
|
||||
|
||||
# `ApiSignUpEmailPasswordResponse`
|
||||
|
||||
```ts
|
||||
type ApiSignUpEmailPasswordResponse =
|
||||
| { session: null; error: ErrorPayload }
|
||||
| { session: Session; error: null }
|
||||
```
|
||||
@@ -4,7 +4,7 @@ title: AuthChangeEvent
|
||||
sidebar_label: AuthChangeEvent
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L135
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L118
|
||||
---
|
||||
|
||||
# `AuthChangeEvent`
|
||||
|
||||
@@ -4,7 +4,7 @@ title: AuthChangedFunction
|
||||
sidebar_label: AuthChangedFunction
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L137
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L120
|
||||
---
|
||||
|
||||
# `AuthChangedFunction`
|
||||
@@ -12,6 +12,6 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
|
||||
```ts
|
||||
type AuthChangedFunction = () => (
|
||||
event: AuthChangeEvent,
|
||||
session: Session | null
|
||||
session: NhostSession | null
|
||||
) => void
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ title: ChangeEmailParams
|
||||
sidebar_label: ChangeEmailParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L106
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L99
|
||||
---
|
||||
|
||||
# `ChangeEmailParams`
|
||||
|
||||
@@ -4,7 +4,7 @@ title: ChangePasswordParams
|
||||
sidebar_label: ChangePasswordParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L96
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L89
|
||||
---
|
||||
|
||||
# `ChangePasswordParams`
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: Mfa
|
||||
sidebar_label: Mfa
|
||||
title: CommonSignUpParams
|
||||
sidebar_label: CommonSignUpParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L143
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L25
|
||||
---
|
||||
|
||||
# `Mfa`
|
||||
# `CommonSignUpParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">ticket</span>** <span className="optional-status">required</span> `string`
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `SignUpOptions`
|
||||
|
||||
---
|
||||
@@ -4,14 +4,14 @@ title: DeanonymizeParams
|
||||
sidebar_label: DeanonymizeParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L111
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L104
|
||||
---
|
||||
|
||||
# `DeanonymizeParams`
|
||||
|
||||
```ts
|
||||
type DeanonymizeParams =
|
||||
| ({ signInMethod: 'email-password' } & SignUpParams)
|
||||
| ({ signInMethod: 'email-password' } & SignUpEmailPasswordParams)
|
||||
| ({
|
||||
signInMethod: 'passwordless'
|
||||
connection: 'email'
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: Headers
|
||||
sidebar_label: Headers
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L140
|
||||
---
|
||||
|
||||
# `Headers`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">Authorization</span>** <span className="optional-status">optional</span> `string`
|
||||
|
||||
---
|
||||
@@ -4,7 +4,7 @@ title: NhostAuthConstructorParams
|
||||
sidebar_label: NhostAuthConstructorParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L15
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L17
|
||||
---
|
||||
|
||||
# `NhostAuthConstructorParams`
|
||||
|
||||
@@ -4,11 +4,11 @@ title: OnTokenChangedFunction
|
||||
sidebar_label: OnTokenChangedFunction
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L139
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L122
|
||||
---
|
||||
|
||||
# `OnTokenChangedFunction`
|
||||
|
||||
```ts
|
||||
type OnTokenChangedFunction = () => (session: Session | null) => void
|
||||
type OnTokenChangedFunction = () => (session: NhostSession | null) => void
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Provider
|
||||
sidebar_label: Provider
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/core/src/types.ts#L140
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/core/src/types.ts#L153
|
||||
---
|
||||
|
||||
# `Provider`
|
||||
@@ -24,4 +24,5 @@ type Provider =
|
||||
| 'bitbucket'
|
||||
| 'discord'
|
||||
| 'twitch'
|
||||
| 'workos'
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ title: ResetPasswordParams
|
||||
sidebar_label: ResetPasswordParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L91
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L84
|
||||
---
|
||||
|
||||
# `ResetPasswordParams`
|
||||
|
||||
@@ -4,7 +4,7 @@ title: SendVerificationEmailParams
|
||||
sidebar_label: SendVerificationEmailParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L101
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L94
|
||||
---
|
||||
|
||||
# `SendVerificationEmailParams`
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: Session
|
||||
sidebar_label: Session
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L23
|
||||
---
|
||||
|
||||
# `Session`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">accessToken</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">accessTokenExpiresIn</span>** <span className="optional-status">required</span> `number`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">refreshToken</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">user</span>** <span className="optional-status">required</span> `null` | [`User`](/reference/docgen/javascript/auth/types/user)
|
||||
|
||||
---
|
||||
@@ -4,7 +4,7 @@ title: SignInEmailPasswordOtpParams
|
||||
sidebar_label: SignInEmailPasswordOtpParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L59
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L46
|
||||
---
|
||||
|
||||
# `SignInEmailPasswordOtpParams`
|
||||
|
||||
@@ -4,7 +4,7 @@ title: SignInEmailPasswordParams
|
||||
sidebar_label: SignInEmailPasswordParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L54
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L41
|
||||
---
|
||||
|
||||
# `SignInEmailPasswordParams`
|
||||
|
||||
@@ -4,7 +4,7 @@ title: SignInParams
|
||||
sidebar_label: SignInParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L83
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L75
|
||||
---
|
||||
|
||||
# `SignInParams`
|
||||
@@ -14,6 +14,7 @@ type SignInParams =
|
||||
| SignInEmailPasswordParams
|
||||
| SignInEmailPasswordOtpParams
|
||||
| SignInPasswordlessEmailParams
|
||||
| SignInPasswordlessSecurityKeyParams
|
||||
| SignInPasswordlessSmsOtpParams
|
||||
| SignInPasswordlessSmsParams
|
||||
| SignInWithProviderOptions
|
||||
|
||||
@@ -4,7 +4,7 @@ title: SignInPasswordlessEmailParams
|
||||
sidebar_label: SignInPasswordlessEmailParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L64
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L51
|
||||
---
|
||||
|
||||
# `SignInPasswordlessEmailParams`
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignInPasswordlessSecurityKeyParams
|
||||
sidebar_label: SignInPasswordlessSecurityKeyParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L56
|
||||
---
|
||||
|
||||
# `SignInPasswordlessSecurityKeyParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">securityKey</span>** <span className="optional-status">required</span> `"true"`
|
||||
|
||||
---
|
||||
@@ -4,7 +4,7 @@ title: SignInPasswordlessSmsOtpParams
|
||||
sidebar_label: SignInPasswordlessSmsOtpParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L74
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L66
|
||||
---
|
||||
|
||||
# `SignInPasswordlessSmsOtpParams`
|
||||
|
||||
@@ -4,7 +4,7 @@ title: SignInPasswordlessSmsParams
|
||||
sidebar_label: SignInPasswordlessSmsParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L69
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L61
|
||||
---
|
||||
|
||||
# `SignInPasswordlessSmsParams`
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignInReponse
|
||||
sidebar_label: SignInReponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L124
|
||||
---
|
||||
|
||||
# `SignInReponse`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">session</span>** <span className="optional-status">required</span> `null` | [`Session`](/reference/docgen/javascript/auth/types/session)
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">mfa</span>** <span className="optional-status">optional</span> `{ enabled: boolean, ticket: string }`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">providerUrl</span>** <span className="optional-status">optional</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">provider</span>** <span className="optional-status">optional</span> `string`
|
||||
|
||||
---
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignInResponse
|
||||
sidebar_label: SignInResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L45
|
||||
---
|
||||
|
||||
# `SignInResponse`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">session</span>** <span className="optional-status">required</span> `null` | [`Session`](/reference/docgen/javascript/auth/types/session)
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">mfa</span>** <span className="optional-status">required</span> `null` | `{ ticket: string }`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">providerUrl</span>** <span className="optional-status">optional</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">provider</span>** <span className="optional-status">optional</span> `string`
|
||||
|
||||
---
|
||||
@@ -4,19 +4,13 @@ title: SignInWithProviderOptions
|
||||
sidebar_label: SignInWithProviderOptions
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L78
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L71
|
||||
---
|
||||
|
||||
# `SignInWithProviderOptions`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">provider</span>** <span className="optional-status">required</span> [`Provider`](/reference/docgen/javascript/auth/types/provider)
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `ProviderOptions`
|
||||
|
||||
---
|
||||
```ts
|
||||
type SignInWithProviderOptions =
|
||||
| { provider: Exclude<Provider, 'workos'>; options: CommonProviderOptions }
|
||||
| { provider: 'workos'; options: WorkOsOptions }
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ title: SignUpEmailPasswordParams
|
||||
sidebar_label: SignUpEmailPasswordParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L31
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L29
|
||||
---
|
||||
|
||||
# `SignUpEmailPasswordParams`
|
||||
@@ -13,7 +13,7 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> `string`
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `SignUpOptions`
|
||||
|
||||
---
|
||||
|
||||
@@ -21,6 +21,6 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `SignUpOptions`
|
||||
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
@@ -4,7 +4,11 @@ title: SignUpParams
|
||||
sidebar_label: SignUpParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L37
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L40
|
||||
---
|
||||
|
||||
# `SignUpParams`
|
||||
|
||||
```ts
|
||||
type SignUpParams = SignUpEmailPasswordParams | SignUpSecurityKeyParams
|
||||
```
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignUpResponse
|
||||
sidebar_label: SignUpResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L39
|
||||
---
|
||||
|
||||
# `SignUpResponse`
|
||||
|
||||
```ts
|
||||
type SignUpResponse =
|
||||
| { session: null; error: ErrorPayload }
|
||||
| { session: Session | null; error: null }
|
||||
```
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignUpSecurityKeyParams
|
||||
sidebar_label: SignUpSecurityKeyParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L34
|
||||
---
|
||||
|
||||
# `SignUpSecurityKeyParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `SignUpSecurityKeyOptions`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">securityKey</span>** <span className="optional-status">required</span> `"true"`
|
||||
|
||||
---
|
||||
@@ -4,7 +4,7 @@ title: User
|
||||
sidebar_label: User
|
||||
description: User information
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/core/src/types.ts#L93
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/core/src/types.ts#L106
|
||||
---
|
||||
|
||||
# `User`
|
||||
|
||||
@@ -4,7 +4,7 @@ title: NhostAuthConstructorParams
|
||||
sidebar_label: NhostAuthConstructorParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L15
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L17
|
||||
---
|
||||
|
||||
# `NhostAuthConstructorParams`
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: useAddSecurityKey()
|
||||
sidebar_label: useAddSecurityKey()
|
||||
slug: /reference/nextjs/use-add-security-key
|
||||
description: Use the hook `useAddSecurityKey` to add a WebAuthn security key.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useAddSecurityKey.ts#L45
|
||||
---
|
||||
|
||||
# `useAddSecurityKey()`
|
||||
|
||||
Use the hook `useAddSecurityKey` to add a WebAuthn security key.
|
||||
|
||||
```tsx
|
||||
const { add, isLoading, isSuccess, isError, error } = useAddSecurityKey()
|
||||
|
||||
const handleFormSubmit = async (e) => {
|
||||
e.preventDefault()
|
||||
|
||||
await add('key nickname')
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: useSignInEmailSecurityKey()
|
||||
sidebar_label: useSignInEmailSecurityKey()
|
||||
slug: /reference/nextjs/use-sign-in-email-security-key
|
||||
description: Use the hook `useSignInEmailSecurityKey` to sign in a user using their email and a security key using the WebAuthn API.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignInEmailSecurityKey.ts#L41
|
||||
---
|
||||
|
||||
# `useSignInEmailSecurityKey()`
|
||||
|
||||
Use the hook `useSignInEmailSecurityKey` to sign in a user using their email and a security key using the WebAuthn API.
|
||||
|
||||
```tsx
|
||||
const {
|
||||
signInEmailSecurityKey,
|
||||
needsEmailVerification,
|
||||
isLoading,
|
||||
isSuccess,
|
||||
isError,
|
||||
error
|
||||
} = useSignInEmailSecurityKey()
|
||||
|
||||
console.log({ needsEmailVerification, isLoading, isSuccess, isError, error })
|
||||
|
||||
const handleFormSubmit = async (e) => {
|
||||
e.preventDefault()
|
||||
|
||||
await signInEmailSecurityKey('joe@example.com')
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: useSignUpEmailSecurityKeyEmail()
|
||||
sidebar_label: useSignUpEmailSecurityKeyEmail()
|
||||
slug: /reference/nextjs/use-sign-up-email-security-key-email
|
||||
description: Use the hook `useSignUpEmailSecurityKey` to sign up a user with security key and an email using the WebAuthn API.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignUpEmailSecurityKey.ts#L43
|
||||
---
|
||||
|
||||
# `useSignUpEmailSecurityKeyEmail()`
|
||||
|
||||
Use the hook `useSignUpEmailSecurityKey` to sign up a user with security key and an email using the WebAuthn API.
|
||||
|
||||
```tsx
|
||||
const {
|
||||
signUpEmailSecurityKey,
|
||||
needsEmailVerification,
|
||||
isLoading,
|
||||
isSuccess,
|
||||
isError,
|
||||
error
|
||||
} = useSignUpEmailSecurityKey()
|
||||
|
||||
console.log({ needsEmailVerification, isLoading, isSuccess, isError, error })
|
||||
|
||||
const handleFormSubmit = async (e) => {
|
||||
e.preventDefault()
|
||||
|
||||
await signUpEmailSecurityKey('joe@example.com')
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `SignUpSecurityKeyOptions`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: AddSecuritKeyHookResult
|
||||
sidebar_label: AddSecuritKeyHookResult
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useAddSecurityKey.ts#L20
|
||||
---
|
||||
|
||||
# `AddSecuritKeyHookResult`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
**`@returns`**
|
||||
|
||||
`true` if an error occurred
|
||||
|
||||
**`@depreacted`**
|
||||
|
||||
use `!isSuccess` or `!!error` instead
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||
|
||||
Provides details about the error
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isSuccess</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
Returns `true` if the action is successful.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">add</span>** <span className="optional-status">required</span> `AddSecurityKeyHandler`
|
||||
|
||||
Add a security key to the current user with the WebAuthn API
|
||||
|
||||
---
|
||||
@@ -4,7 +4,7 @@ title: NhostSession
|
||||
sidebar_label: NhostSession
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/core/src/types.ts#L128
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/core/src/types.ts#L141
|
||||
---
|
||||
|
||||
# `NhostSession`
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignInSecurityKeyPasswordlessHookResult
|
||||
sidebar_label: SignInSecurityKeyPasswordlessHookResult
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignInEmailSecurityKey.ts#L14
|
||||
---
|
||||
|
||||
# `SignInSecurityKeyPasswordlessHookResult`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
**`@returns`**
|
||||
|
||||
`true` if an error occurred
|
||||
|
||||
**`@depreacted`**
|
||||
|
||||
use `!isSuccess` or `!!error` instead
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||
|
||||
Provides details about the error
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isLoading</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
**`@returns`**
|
||||
|
||||
`true` when the action is executing, `false` when it finished its execution.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isSuccess</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
Returns `true` if the action is successful.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">user</span>** <span className="optional-status">required</span> `null` | `User`
|
||||
|
||||
User information
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">accessToken</span>** <span className="optional-status">required</span> `null` | `string`
|
||||
|
||||
Access token (JWT)
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">needsEmailVerification</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
**`@returns`**
|
||||
|
||||
`true` if an email is required to complete the action, and that a verification email has been sent to complete the action.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">signInEmailSecurityKey</span>** <span className="optional-status">required</span> `SignInSecurityKeyPasswordlessHandler`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,72 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignUpSecurityKeyHookResult
|
||||
sidebar_label: SignUpSecurityKeyHookResult
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignUpEmailSecurityKey.ts#L16
|
||||
---
|
||||
|
||||
# `SignUpSecurityKeyHookResult`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
**`@returns`**
|
||||
|
||||
`true` if an error occurred
|
||||
|
||||
**`@depreacted`**
|
||||
|
||||
use `!isSuccess` or `!!error` instead
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||
|
||||
Provides details about the error
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isLoading</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
**`@returns`**
|
||||
|
||||
`true` when the action is executing, `false` when it finished its execution.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isSuccess</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
Returns `true` if the action is successful.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">user</span>** <span className="optional-status">required</span> `null` | `User`
|
||||
|
||||
User information
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">accessToken</span>** <span className="optional-status">required</span> `null` | `string`
|
||||
|
||||
Access token (JWT)
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">needsEmailVerification</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
**`@returns`**
|
||||
|
||||
`true` if an email is required to complete the action, and that a verification email has been sent to complete the action.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">signUpEmailSecurityKey</span>** <span className="optional-status">required</span> `SignUpSecurityKeyHandler`
|
||||
|
||||
Used for a new user to sign up with a security key. Returns a promise with the current context
|
||||
|
||||
---
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: useAddSecurityKey()
|
||||
sidebar_label: useAddSecurityKey()
|
||||
slug: /reference/react/use-add-security-key
|
||||
description: Use the hook `useAddSecurityKey` to add a WebAuthn security key.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useAddSecurityKey.ts#L45
|
||||
---
|
||||
|
||||
# `useAddSecurityKey()`
|
||||
|
||||
Use the hook `useAddSecurityKey` to add a WebAuthn security key.
|
||||
|
||||
```tsx
|
||||
const { add, isLoading, isSuccess, isError, error } = useAddSecurityKey()
|
||||
|
||||
const handleFormSubmit = async (e) => {
|
||||
e.preventDefault()
|
||||
|
||||
await add('key nickname')
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: useSignInEmailSecurityKey()
|
||||
sidebar_label: useSignInEmailSecurityKey()
|
||||
slug: /reference/react/use-sign-in-email-security-key
|
||||
description: Use the hook `useSignInEmailSecurityKey` to sign in a user using their email and a security key using the WebAuthn API.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignInEmailSecurityKey.ts#L41
|
||||
---
|
||||
|
||||
# `useSignInEmailSecurityKey()`
|
||||
|
||||
Use the hook `useSignInEmailSecurityKey` to sign in a user using their email and a security key using the WebAuthn API.
|
||||
|
||||
```tsx
|
||||
const {
|
||||
signInEmailSecurityKey,
|
||||
needsEmailVerification,
|
||||
isLoading,
|
||||
isSuccess,
|
||||
isError,
|
||||
error
|
||||
} = useSignInEmailSecurityKey()
|
||||
|
||||
console.log({ needsEmailVerification, isLoading, isSuccess, isError, error })
|
||||
|
||||
const handleFormSubmit = async (e) => {
|
||||
e.preventDefault()
|
||||
|
||||
await signInEmailSecurityKey('joe@example.com')
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: useSignUpEmailSecurityKeyEmail()
|
||||
sidebar_label: useSignUpEmailSecurityKeyEmail()
|
||||
slug: /reference/react/use-sign-up-email-security-key-email
|
||||
description: Use the hook `useSignUpEmailSecurityKey` to sign up a user with security key and an email using the WebAuthn API.
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignUpEmailSecurityKey.ts#L43
|
||||
---
|
||||
|
||||
# `useSignUpEmailSecurityKeyEmail()`
|
||||
|
||||
Use the hook `useSignUpEmailSecurityKey` to sign up a user with security key and an email using the WebAuthn API.
|
||||
|
||||
```tsx
|
||||
const {
|
||||
signUpEmailSecurityKey,
|
||||
needsEmailVerification,
|
||||
isLoading,
|
||||
isSuccess,
|
||||
isError,
|
||||
error
|
||||
} = useSignUpEmailSecurityKey()
|
||||
|
||||
console.log({ needsEmailVerification, isLoading, isSuccess, isError, error })
|
||||
|
||||
const handleFormSubmit = async (e) => {
|
||||
e.preventDefault()
|
||||
|
||||
await signUpEmailSecurityKey('joe@example.com')
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `SignUpSecurityKeyOptions`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: AddSecuritKeyHookResult
|
||||
sidebar_label: AddSecuritKeyHookResult
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useAddSecurityKey.ts#L20
|
||||
---
|
||||
|
||||
# `AddSecuritKeyHookResult`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
**`@returns`**
|
||||
|
||||
`true` if an error occurred
|
||||
|
||||
**`@depreacted`**
|
||||
|
||||
use `!isSuccess` or `!!error` instead
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||
|
||||
Provides details about the error
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isSuccess</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
Returns `true` if the action is successful.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">add</span>** <span className="optional-status">required</span> `AddSecurityKeyHandler`
|
||||
|
||||
Add a security key to the current user with the WebAuthn API
|
||||
|
||||
---
|
||||
@@ -0,0 +1,70 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignInSecurityKeyPasswordlessHookResult
|
||||
sidebar_label: SignInSecurityKeyPasswordlessHookResult
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignInEmailSecurityKey.ts#L14
|
||||
---
|
||||
|
||||
# `SignInSecurityKeyPasswordlessHookResult`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
**`@returns`**
|
||||
|
||||
`true` if an error occurred
|
||||
|
||||
**`@depreacted`**
|
||||
|
||||
use `!isSuccess` or `!!error` instead
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||
|
||||
Provides details about the error
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isLoading</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
**`@returns`**
|
||||
|
||||
`true` when the action is executing, `false` when it finished its execution.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isSuccess</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
Returns `true` if the action is successful.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">user</span>** <span className="optional-status">required</span> `null` | `User`
|
||||
|
||||
User information
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">accessToken</span>** <span className="optional-status">required</span> `null` | `string`
|
||||
|
||||
Access token (JWT)
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">needsEmailVerification</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
**`@returns`**
|
||||
|
||||
`true` if an email is required to complete the action, and that a verification email has been sent to complete the action.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">signInEmailSecurityKey</span>** <span className="optional-status">required</span> `SignInSecurityKeyPasswordlessHandler`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,72 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignUpSecurityKeyHookResult
|
||||
sidebar_label: SignUpSecurityKeyHookResult
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignUpEmailSecurityKey.ts#L16
|
||||
---
|
||||
|
||||
# `SignUpSecurityKeyHookResult`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
**`@returns`**
|
||||
|
||||
`true` if an error occurred
|
||||
|
||||
**`@depreacted`**
|
||||
|
||||
use `!isSuccess` or `!!error` instead
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||
|
||||
Provides details about the error
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isLoading</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
**`@returns`**
|
||||
|
||||
`true` when the action is executing, `false` when it finished its execution.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isSuccess</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
Returns `true` if the action is successful.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">user</span>** <span className="optional-status">required</span> `null` | `User`
|
||||
|
||||
User information
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">accessToken</span>** <span className="optional-status">required</span> `null` | `string`
|
||||
|
||||
Access token (JWT)
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">needsEmailVerification</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
**`@returns`**
|
||||
|
||||
`true` if an email is required to complete the action, and that a verification email has been sent to complete the action.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">signUpEmailSecurityKey</span>** <span className="optional-status">required</span> `SignUpSecurityKeyHandler`
|
||||
|
||||
Used for a new user to sign up with a security key. Returns a promise with the current context
|
||||
|
||||
---
|
||||
@@ -5,9 +5,9 @@ services:
|
||||
environment:
|
||||
hasura_graphql_enable_remote_schema_permissions: false
|
||||
auth:
|
||||
image: nhost/hasura-auth:0.10.0
|
||||
image: nhost/hasura-auth:0.13.0
|
||||
storage:
|
||||
image: nhost/hasura-storage:0.2.3
|
||||
image: nhost/hasura-storage:0.2.4
|
||||
auth:
|
||||
access_control:
|
||||
email:
|
||||
|
||||
@@ -5,9 +5,9 @@ services:
|
||||
environment:
|
||||
hasura_graphql_enable_remote_schema_permissions: false
|
||||
auth:
|
||||
image: nhost/hasura-auth:0.10.0
|
||||
image: nhost/hasura-auth:0.13.0
|
||||
storage:
|
||||
image: nhost/hasura-storage:0.2.3
|
||||
image: nhost/hasura-storage:0.2.4
|
||||
auth:
|
||||
access_control:
|
||||
email:
|
||||
|
||||
9
examples/docker-compose/functions/package.json
Normal file
9
examples/docker-compose/functions/package.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "functions",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
}
|
||||
11
examples/docker-compose/functions/tsconfig.json
Normal file
11
examples/docker-compose/functions/tsconfig.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"strictNullChecks": false
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,9 @@ services:
|
||||
environment:
|
||||
hasura_graphql_enable_remote_schema_permissions: false
|
||||
auth:
|
||||
image: nhost/hasura-auth:0.10.0
|
||||
image: nhost/hasura-auth:0.13.0
|
||||
storage:
|
||||
image: nhost/hasura-storage:0.2.3
|
||||
image: nhost/hasura-storage:0.2.4
|
||||
auth:
|
||||
access_control:
|
||||
email:
|
||||
|
||||
@@ -5,9 +5,9 @@ services:
|
||||
environment:
|
||||
hasura_graphql_enable_remote_schema_permissions: false
|
||||
auth:
|
||||
image: nhost/hasura-auth:0.10.0
|
||||
image: nhost/hasura-auth:0.13.0
|
||||
storage:
|
||||
image: nhost/hasura-storage:0.2.3
|
||||
image: nhost/hasura-storage:0.2.4
|
||||
auth:
|
||||
access_control:
|
||||
email:
|
||||
|
||||
@@ -5,9 +5,9 @@ services:
|
||||
environment:
|
||||
hasura_graphql_enable_remote_schema_permissions: false
|
||||
auth:
|
||||
image: nhost/hasura-auth:0.10.0
|
||||
image: nhost/hasura-auth:0.13.0
|
||||
storage:
|
||||
image: nhost/hasura-storage:0.2.3
|
||||
image: nhost/hasura-storage:0.2.4
|
||||
auth:
|
||||
access_control:
|
||||
email:
|
||||
|
||||
34
examples/react-apollo/CHANGELOG.md
Normal file
34
examples/react-apollo/CHANGELOG.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# @nhost-examples/react-apollo
|
||||
|
||||
## 0.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 739a3c45: Sign up with an email and a security key.
|
||||
|
||||
Use the hook `useSignUpEmailSecurityKey` to sign up a user with security key and an email using the WebAuthn API.
|
||||
|
||||
```tsx
|
||||
const {
|
||||
signUpEmailSecurityKey,
|
||||
needsEmailVerification,
|
||||
isLoading,
|
||||
isSuccess,
|
||||
isError,
|
||||
error
|
||||
} = useSignUpEmailSecurityKey()
|
||||
|
||||
console.log({ needsEmailVerification, isLoading, isSuccess, isError, error })
|
||||
|
||||
const handleFormSubmit = async (e) => {
|
||||
e.preventDefault()
|
||||
await signUpEmailSecurityKey('joe@example.com')
|
||||
}
|
||||
```
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [739a3c45]
|
||||
- Updated dependencies [74758f2c]
|
||||
- @nhost/react@0.13.0
|
||||
- @nhost/react-apollo@5.0.0
|
||||
@@ -37,3 +37,4 @@ nhost dev
|
||||
```sh
|
||||
pnpm run dev
|
||||
```
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ context('Anonymous users', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('should deanonymise with passwordless email', () => {
|
||||
it('should deanonymise with a magic link', () => {
|
||||
cy.fetchUserData()
|
||||
.its('id')
|
||||
.then((id) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { faker } from '@faker-js/faker'
|
||||
|
||||
context('Sign up with passwordless email', () => {
|
||||
it('should sign-up with passwordless email', () => {
|
||||
context('Sign up with a magic link', () => {
|
||||
it('should sign-up with a magic link', () => {
|
||||
const email = faker.internet.email()
|
||||
cy.signUpEmailPasswordless(email)
|
||||
cy.contains('Verification email sent').should('be.visible')
|
||||
|
||||
@@ -11,7 +11,7 @@ context('Sign in with email+password', () => {
|
||||
cy.contains('Verification email sent').should('be.visible')
|
||||
cy.confirmEmail(email)
|
||||
cy.signOut()
|
||||
cy.contains('Log in to the Application').should('be.visible')
|
||||
cy.contains('Sign in to the Application').should('be.visible')
|
||||
cy.signInEmailPassword(email, password)
|
||||
|
||||
cy.contains('You are authenticated')
|
||||
|
||||
@@ -4,7 +4,7 @@ context('Sign in with a refresh token', () => {
|
||||
cy.contains('Profile page')
|
||||
cy.clearLocalStorage()
|
||||
cy.reload()
|
||||
cy.contains('Log in to the Application')
|
||||
cy.contains('Sign in to the Application')
|
||||
cy.visitPathWithRefreshToken('/profile')
|
||||
cy.contains('Profile page')
|
||||
})
|
||||
@@ -15,7 +15,7 @@ context('Sign in with a refresh token', () => {
|
||||
cy.disconnectBackend()
|
||||
cy.clearLocalStorage()
|
||||
cy.reload()
|
||||
cy.contains('Log in to the Application')
|
||||
cy.contains('Sign in to the Application')
|
||||
cy.visitPathWithRefreshToken('/profile')
|
||||
cy.location('pathname').should('equal', '/sign-in')
|
||||
})
|
||||
|
||||
@@ -8,6 +8,6 @@ context('Sign out', () => {
|
||||
cy.goToProfilePage()
|
||||
cy.contains('Profile page')
|
||||
cy.signOut()
|
||||
cy.contains('Log in to the Application')
|
||||
cy.contains('Sign in to the Application')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -52,7 +52,7 @@ Cypress.Commands.add('signUpEmailPassword', (email, password) => {
|
||||
|
||||
Cypress.Commands.add('signUpEmailPasswordless', (email) => {
|
||||
cy.visit('/sign-up')
|
||||
cy.findByRole('button', { name: /Continue with passwordless email/i }).click()
|
||||
cy.findByRole('button', { name: /Continue with a magic link/i }).click()
|
||||
cy.findByPlaceholderText('Email Address').type(email)
|
||||
cy.findByRole('button', { name: /Continue with email/i }).click()
|
||||
})
|
||||
|
||||
@@ -10,6 +10,12 @@ generates:
|
||||
namingConvention:
|
||||
typeNames: change-case-all#pascalCase
|
||||
transformUnderscore: true
|
||||
scalars:
|
||||
uuid: string
|
||||
bigint: number
|
||||
citext: string
|
||||
timestamptz: string
|
||||
|
||||
plugins:
|
||||
- typescript
|
||||
- typescript-operations
|
||||
|
||||
@@ -5,9 +5,9 @@ services:
|
||||
environment:
|
||||
hasura_graphql_enable_remote_schema_permissions: false
|
||||
auth:
|
||||
image: nhost/hasura-auth:0.10.0
|
||||
image: nhost/hasura-auth:0.13.0
|
||||
storage:
|
||||
image: nhost/hasura-storage:0.2.3
|
||||
image: nhost/hasura-storage:0.2.4
|
||||
auth:
|
||||
access_control:
|
||||
email:
|
||||
@@ -127,6 +127,9 @@ auth:
|
||||
mfa:
|
||||
enabled: true
|
||||
issuer: nhost
|
||||
webauthn:
|
||||
enabled: true
|
||||
rp_name: Nhost React Apollo Example
|
||||
storage:
|
||||
force_download_for_content_types: text/html,application/javascript
|
||||
version: 3
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
table:
|
||||
name: user_authenticators
|
||||
schema: auth
|
||||
configuration:
|
||||
column_config:
|
||||
credential_id:
|
||||
custom_name: credentialId
|
||||
credential_public_key:
|
||||
custom_name: credentialPublicKey
|
||||
user_id:
|
||||
custom_name: userId
|
||||
custom_column_names:
|
||||
credential_id: credentialId
|
||||
credential_public_key: credentialPublicKey
|
||||
user_id: userId
|
||||
custom_name: authUserAuthenticators
|
||||
custom_root_fields:
|
||||
delete: deleteAuthUserAuthenticators
|
||||
delete_by_pk: deleteAuthUserAuthenticator
|
||||
insert: insertAuthUserAuthenticators
|
||||
insert_one: insertAuthUserAuthenticator
|
||||
select: authUserAuthenticators
|
||||
select_aggregate: authUserAuthenticatorsAggregate
|
||||
select_by_pk: authUserAuthenticator
|
||||
update: updateAuthUserAuthenticators
|
||||
update_by_pk: updateAuthUserAuthenticator
|
||||
object_relationships:
|
||||
- name: user
|
||||
using:
|
||||
foreign_key_constraint_on: user_id
|
||||
@@ -0,0 +1,47 @@
|
||||
table:
|
||||
name: user_security_keys
|
||||
schema: auth
|
||||
configuration:
|
||||
column_config:
|
||||
credential_id:
|
||||
custom_name: credentialId
|
||||
credential_public_key:
|
||||
custom_name: credentialPublicKey
|
||||
user_id:
|
||||
custom_name: userId
|
||||
custom_column_names:
|
||||
credential_id: credentialId
|
||||
credential_public_key: credentialPublicKey
|
||||
user_id: userId
|
||||
custom_name: authUserSecurityKeys
|
||||
custom_root_fields:
|
||||
delete: deleteAuthUserSecurityKeys
|
||||
delete_by_pk: deleteAuthUserSecurityKey
|
||||
insert: insertAuthUserSecurityKeys
|
||||
insert_one: insertAuthUserSecurityKey
|
||||
select: authUserSecurityKeys
|
||||
select_aggregate: authUserSecurityKeysAggregate
|
||||
select_by_pk: authUserSecurityKey
|
||||
update: updateAuthUserSecurityKeys
|
||||
update_by_pk: updateAuthUserSecurityKey
|
||||
object_relationships:
|
||||
- name: user
|
||||
using:
|
||||
foreign_key_constraint_on: user_id
|
||||
select_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
columns:
|
||||
- id
|
||||
- nickname
|
||||
- user_id
|
||||
filter:
|
||||
user_id:
|
||||
_eq: X-Hasura-User-Id
|
||||
delete_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
backend_only: false
|
||||
filter:
|
||||
user_id:
|
||||
_eq: X-Hasura-User-Id
|
||||
@@ -77,13 +77,6 @@ object_relationships:
|
||||
using:
|
||||
foreign_key_constraint_on: default_role
|
||||
array_relationships:
|
||||
- name: authenticators
|
||||
using:
|
||||
foreign_key_constraint_on:
|
||||
column: user_id
|
||||
table:
|
||||
name: user_authenticators
|
||||
schema: auth
|
||||
- name: refreshTokens
|
||||
using:
|
||||
foreign_key_constraint_on:
|
||||
@@ -98,6 +91,13 @@ array_relationships:
|
||||
table:
|
||||
name: user_roles
|
||||
schema: auth
|
||||
- name: securityKeys
|
||||
using:
|
||||
foreign_key_constraint_on:
|
||||
column: user_id
|
||||
table:
|
||||
name: user_security_keys
|
||||
schema: auth
|
||||
- name: userProviders
|
||||
using:
|
||||
foreign_key_constraint_on:
|
||||
@@ -105,3 +105,29 @@ array_relationships:
|
||||
table:
|
||||
name: user_providers
|
||||
schema: auth
|
||||
select_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
columns:
|
||||
- active_mfa_type
|
||||
- avatar_url
|
||||
- created_at
|
||||
- default_role
|
||||
- disabled
|
||||
- display_name
|
||||
- email
|
||||
- email_verified
|
||||
- id
|
||||
- is_anonymous
|
||||
- last_seen
|
||||
- locale
|
||||
- metadata
|
||||
- otp_hash
|
||||
- otp_method_last_used
|
||||
- phone_number
|
||||
- phone_number_verified
|
||||
- updated_at
|
||||
- webauthn_current_challenge
|
||||
filter:
|
||||
id:
|
||||
_eq: X-Hasura-User-Id
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
- "!include auth_providers.yaml"
|
||||
- "!include auth_refresh_tokens.yaml"
|
||||
- "!include auth_roles.yaml"
|
||||
- "!include auth_user_authenticators.yaml"
|
||||
- "!include auth_user_providers.yaml"
|
||||
- "!include auth_user_roles.yaml"
|
||||
- "!include auth_user_security_keys.yaml"
|
||||
- "!include auth_users.yaml"
|
||||
- "!include public_todos.yaml"
|
||||
- "!include storage_buckets.yaml"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/react-apollo",
|
||||
"version": "0.0.1",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.6.9",
|
||||
|
||||
4735
examples/react-apollo/pnpm-lock.yaml
generated
Normal file
4735
examples/react-apollo/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user