Compare commits
5 Commits
@nhost/str
...
@nhost/apo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f419be2c1 | ||
|
|
93ebdf844f | ||
|
|
bcd889b53a | ||
|
|
992939cdcd | ||
|
|
3c31657c50 |
@@ -1,5 +1,13 @@
|
||||
# @nhost/dashboard
|
||||
|
||||
## 1.12.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 93ebdf8: fix: use service urls when initilizaing NhostClient running local dashboard
|
||||
- @nhost/react-apollo@11.0.1
|
||||
- @nhost/nextjs@2.1.10
|
||||
|
||||
## 1.12.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/dashboard",
|
||||
"version": "1.12.0",
|
||||
"version": "1.12.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
|
||||
@@ -3,18 +3,14 @@ import {
|
||||
getFunctionsServiceUrl,
|
||||
getGraphqlServiceUrl,
|
||||
getStorageServiceUrl,
|
||||
isPlatform,
|
||||
} from '@/utils/env';
|
||||
import { NhostClient } from '@nhost/nextjs';
|
||||
|
||||
// eslint-disable-next-line no-nested-ternary
|
||||
const nhost = isPlatform()
|
||||
? new NhostClient({
|
||||
authUrl: getAuthServiceUrl(),
|
||||
graphqlUrl: getGraphqlServiceUrl(),
|
||||
functionsUrl: getFunctionsServiceUrl(),
|
||||
storageUrl: getStorageServiceUrl(),
|
||||
})
|
||||
: new NhostClient({ subdomain: 'local' });
|
||||
const nhost = new NhostClient({
|
||||
authUrl: getAuthServiceUrl(),
|
||||
graphqlUrl: getGraphqlServiceUrl(),
|
||||
functionsUrl: getFunctionsServiceUrl(),
|
||||
storageUrl: getStorageServiceUrl(),
|
||||
});
|
||||
|
||||
export default nhost;
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# @nhost/docs
|
||||
|
||||
## 2.9.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 3c31657: chore: update docs with provider connect
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 992939c: feat: added social connect docs
|
||||
|
||||
## 2.8.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
43
docs/guides/auth/social-connect.mdx
Normal file
43
docs/guides/auth/social-connect.mdx
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
title: Social Provider Connect
|
||||
sidebarTitle: Social Provider Connect
|
||||
description: Add social sign in mechanism to existing users
|
||||
icon: link
|
||||
---
|
||||
|
||||
With the social provider connect feature, users can link their social authentication method to their account, regardless of the initial sign-up method. It enables users to link different social authentication providers to their accounts, even if the email addresses do not match (e.g., linking a GitHub profile to an account registered with a different email). This feature offers flexibility, allowing users to streamline their login process by connecting multiple authentication methods.
|
||||
|
||||
To add a social authentication method to an existing user you need to call the url `https://${subdomain}.auth.${region}.nhost.run/v1/signin/provider/${provider}?connect=${jwt}`. This is very easy to achieve with our SDK:
|
||||
|
||||
``` js
|
||||
nhost.auth.connectProvider({
|
||||
provider: 'github'
|
||||
})
|
||||
```
|
||||
|
||||
In addition, hooks for react, vue and other frameworks may be provided. Check our [reference](/reference/overview#client-libraries) documentation for more details.
|
||||
|
||||
<Note>
|
||||
Keep in mind that as we need a `JWT` the user needs to be logged in.
|
||||
</Note>
|
||||
|
||||
## Viewing and Deleting Social Provider Authentication Mechanisms
|
||||
|
||||
If you want to allow your users to view and/or delete social provider authentication mechanisms, you can provide the necessary permissions to the table `auth.user_providers` (i.e. `select` and/or `delete`) and then use the appropriate GraphQL query. For example, the following permissions should allow users to list their own social providers:
|
||||
|
||||

|
||||
|
||||
Using the following GraphQL query:
|
||||
|
||||
``` js
|
||||
const { error, data } = await nhost.graphql.request(
|
||||
gql`
|
||||
query getAuthUserProviders {
|
||||
authUserProviders {
|
||||
id
|
||||
providerId
|
||||
}
|
||||
}
|
||||
`,
|
||||
)
|
||||
```
|
||||
BIN
docs/images/guides/auth/social-connect-permissions.png
Normal file
BIN
docs/images/guides/auth/social-connect-permissions.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 245 KiB |
@@ -128,6 +128,7 @@
|
||||
"guides/auth/social/sign-in-workos"
|
||||
]
|
||||
},
|
||||
"guides/auth/social-connect",
|
||||
"guides/auth/sign-in-email-password",
|
||||
"guides/auth/sign-in-magic-link",
|
||||
"guides/auth/sign-in-phone-number",
|
||||
@@ -197,7 +198,7 @@
|
||||
"reference/auth/verfiy-fido2-webauthn-authentication-and-complete-signup",
|
||||
"reference/auth/sign-in-using-email-via-fido2-webauthn-authentication",
|
||||
"reference/auth/verfiy-fido2-webauthn-authentication-using-public-key-cryptography",
|
||||
"reference/auth/elevate-webauthn",
|
||||
"reference/auth/elevate-webauthn",
|
||||
"reference/auth/elevate-webauthn-verify"
|
||||
]
|
||||
},
|
||||
@@ -319,7 +320,8 @@
|
||||
"reference/javascript/auth/sign-out",
|
||||
"reference/javascript/auth/sign-up",
|
||||
"reference/javascript/auth/add-security-key",
|
||||
"reference/javascript/auth/elevate-email-security-key"
|
||||
"reference/javascript/auth/elevate-email-security-key",
|
||||
"reference/javascript/auth/connect-provider"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/docs",
|
||||
"version": "2.8.0",
|
||||
"version": "2.9.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "mintlify dev"
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
title: activateMfaPromise()
|
||||
sidebarTitle: activateMfaPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">service</span>** <span className="optional-status">required</span> <code>Interpreter<EnableMfaContext, any, { type: "GENERATE" } | { type: "ACTIVATE", code: string, activeMfaType: "totp" } | { type: "GENERATED" } | { type: "GENERATED_ERROR", error: null | AuthErrorPayload } | { type: "SUCCESS" } | { type: "ERROR", error: null | AuthErrorPayload }, { value: any, context: EnableMfaContext }, ResolveTypegenMeta<Typegen0, { type: "GENERATE" } | { type: "ACTIVATE", code: string, activeMfaType: "totp" } | { type: "GENERATED" } | { type: "GENERATED_ERROR", error: null | AuthErrorPayload } | { type: "SUCCESS" } | { type: "ERROR", error: null | AuthErrorPayload }, BaseActionObject, ServiceMap>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">code</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
title: addSecurityKeyPromise()
|
||||
sidebarTitle: addSecurityKeyPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">nickname</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||
|
||||
---
|
||||
@@ -1,24 +0,0 @@
|
||||
---
|
||||
title: changeEmailPromise()
|
||||
sidebarTitle: changeEmailPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter<ChangeEmailContext, any, { type: "REQUEST", email: string, options: ChangeEmailOptions } | { type: "SUCCESS" } | { type: "ERROR", error: null | AuthErrorPayload }, { value: any, context: ChangeEmailContext }, ResolveTypegenMeta<Typegen0, { type: "REQUEST", email: string, options: ChangeEmailOptions } | { type: "SUCCESS" } | { type: "ERROR", error: null | AuthErrorPayload }, BaseActionObject, ChangeEmailServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`ChangeEmailOptions`](/reference/javascript/auth/types/change-email-options)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :--------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
|
||||
|
||||
---
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
title: changePasswordPromise()
|
||||
sidebarTitle: changePasswordPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter<ChangePasswordContext, any, { type: "REQUEST", password: string, ticket: string } | { type: "SUCCESS" } | { type: "ERROR", error: null | AuthErrorPayload }, { value: any, context: ChangePasswordContext }, ResolveTypegenMeta<Typegen0, { type: "REQUEST", password: string, ticket: string } | { type: "SUCCESS" } | { type: "ERROR", error: null | AuthErrorPayload }, BaseActionObject, ChangePasswordServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">ticket</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||
|
||||
---
|
||||
@@ -1,23 +0,0 @@
|
||||
---
|
||||
title: createAuthMachine()
|
||||
sidebarTitle: createAuthMachine()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`AuthMachineOptions`](/reference/javascript/auth/types/auth-machine-options)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientUrl</span> | <code>string</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>backendUrl</span> | <code>string</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>devTools</span> | <code>boolean</code> | | Activate devTools e.g. the ability to connect to the xstate inspector |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoSignIn</span> | <code>boolean</code> | | When set to true, will parse the url on startup to check if it contains a refresh token to start the session with |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoRefreshToken</span> | <code>boolean</code> | | When set to true, will automatically refresh token before it expires |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorage</span> | [`ClientStorage`](/reference/javascript/auth/types/client-storage) | | Object where the refresh token will be persisted and read locally. |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageType</span> | [`ClientStorageType`](/reference/javascript/auth/types/client-storage-type) | | Define a way to get information about the refresh token and its exipration date. |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>refreshIntervalTime</span> | <code>number</code> | | Time interval until token refreshes, in seconds |
|
||||
|
||||
---
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: createChangeEmailMachine()
|
||||
sidebarTitle: createChangeEmailMachine()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
|
||||
|
||||
---
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: createChangePasswordMachine()
|
||||
sidebarTitle: createChangePasswordMachine()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
|
||||
|
||||
---
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: createEnableMfaMachine()
|
||||
sidebarTitle: createEnableMfaMachine()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
|
||||
|
||||
---
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: createResetPasswordMachine()
|
||||
sidebarTitle: createResetPasswordMachine()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
|
||||
|
||||
---
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: createSendVerificationEmailMachine()
|
||||
sidebarTitle: createSendVerificationEmailMachine()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
|
||||
|
||||
---
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
title: encodeQueryParameters()
|
||||
sidebarTitle: encodeQueryParameters()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">baseUrl</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">parameters</span>** <span className="optional-status">optional</span> <code>Record<string, unknown></code>
|
||||
|
||||
---
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: generateQrCodePromise()
|
||||
sidebarTitle: generateQrCodePromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">service</span>** <span className="optional-status">required</span> <code>Interpreter<EnableMfaContext, any, { type: "GENERATE" } | { type: "ACTIVATE", code: string, activeMfaType: "totp" } | { type: "GENERATED" } | { type: "GENERATED_ERROR", error: null | AuthErrorPayload } | { type: "SUCCESS" } | { type: "ERROR", error: null | AuthErrorPayload }, { value: any, context: EnableMfaContext }, ResolveTypegenMeta<Typegen0, { type: "GENERATE" } | { type: "ACTIVATE", code: string, activeMfaType: "totp" } | { type: "GENERATED" } | { type: "GENERATED_ERROR", error: null | AuthErrorPayload } | { type: "SUCCESS" } | { type: "ERROR", error: null | AuthErrorPayload }, BaseActionObject, ServiceMap>></code>
|
||||
|
||||
---
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
title: getAuthenticationResult()
|
||||
sidebarTitle: getAuthenticationResult()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`SessionActionHandlerResult`](/reference/javascript/auth/types/session-action-handler-result)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :----------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------- | :------: | :------------------------------------------ |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>refreshToken</span> | <code>null | string</code> | ✔️ | Access token (JWT) |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>accessToken</span> | <code>null | string</code> | ✔️ | Access token (JWT) |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>user</span> | <code>null | [`User`](/reference/javascript/auth/types/user)</code> | ✔️ | User information |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>isSuccess</span> | <code>boolean</code> | ✔️ | Returns `true` if the action is successful. |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>error</span> | <code>null | [`AuthErrorPayload`](/reference/javascript/auth/types/auth-error-payload)</code> | ✔️ | Provides details about the error |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>isError</span> | <code>boolean</code> | ✔️ | |
|
||||
|
||||
---
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
title: getFetch()
|
||||
sidebarTitle: getFetch()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">url</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">token</span>** <span className="optional-status">optional</span> <code>null | string</code>
|
||||
|
||||
---
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
title: getParameterByName()
|
||||
sidebarTitle: getParameterByName()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">name</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">url</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||
|
||||
---
|
||||
@@ -1,22 +0,0 @@
|
||||
---
|
||||
title: getSession()
|
||||
sidebarTitle: getSession()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">context</span>** <span className="optional-status">optional</span> [`AuthContext`](/reference/javascript/auth/types/auth-context)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------- | :------: | :------------------------------------------------------------------------------------------------- |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>errors</span> | <code>Partial<Record<StateErrorTypes, AuthErrorPayload>></code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>importTokenAttempts</span> | <code>number</code> | ✔️ | Number of times the user tried to get an access token from a refresh token but got a network error |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>refreshToken</span> | <code>{ value: string | null, isPAT: boolean }</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>refreshTimer</span> | <code>{ startedAt: Date | null, attempts: number, lastAttempt: Date | null }</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>accessToken</span> | <code>{ value: string | null, expiresAt: Date | null, expiresInSeconds: number | null }</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>mfa</span> | <code>{ ticket: string } | null</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>user</span> | <code>[`User`](/reference/javascript/auth/types/user) | null</code> | ✔️ | |
|
||||
|
||||
---
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
title: isBrowser()
|
||||
sidebarTitle: isBrowser()
|
||||
---
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: isValidEmail()
|
||||
sidebarTitle: isValidEmail()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">optional</span> <code>null | string</code>
|
||||
|
||||
---
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: isValidPassword()
|
||||
sidebarTitle: isValidPassword()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">password</span>** <span className="optional-status">optional</span> <code>null | string</code>
|
||||
|
||||
---
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: isValidPhoneNumber()
|
||||
sidebarTitle: isValidPhoneNumber()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">phoneNumber</span>** <span className="optional-status">optional</span> <code>null | string</code>
|
||||
|
||||
---
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: isValidTicket()
|
||||
sidebarTitle: isValidTicket()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">ticket</span>** <span className="optional-status">optional</span> <code>null | string</code>
|
||||
|
||||
---
|
||||
@@ -1,30 +0,0 @@
|
||||
---
|
||||
title: localStorageGetter()
|
||||
sidebarTitle: localStorageGetter()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">clientStorageType</span>** <span className="optional-status">required</span> [`ClientStorageType`](/reference/javascript/auth/types/client-storage-type)
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">clientStorage</span>** <span className="optional-status">optional</span> [`ClientStorage`](/reference/javascript/auth/types/client-storage)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :-------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customSet</span> | <code>(key: string, value: null | string) => void | Promise<void></code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customGet</span> | <code>(key: string) => null | string | Promise<null | string></code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>deleteItemAsync</span> | <code>(key: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItemAsync</span> | <code>(key: string) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItemAsync</span> | <code>(key: string, value: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>remove</span> | <code>(options: { key: string }) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>get</span> | <code>(options: { key: string }) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>set</span> | <code>(options: { key: string, value: string }) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>removeItem</span> | <code>(key: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItem</span> | <code>(key: string) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItem</span> | <code>(\_key: string, \_value: string) => void</code> | | |
|
||||
|
||||
---
|
||||
@@ -1,30 +0,0 @@
|
||||
---
|
||||
title: localStorageSetter()
|
||||
sidebarTitle: localStorageSetter()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">clientStorageType</span>** <span className="optional-status">required</span> [`ClientStorageType`](/reference/javascript/auth/types/client-storage-type)
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">clientStorage</span>** <span className="optional-status">optional</span> [`ClientStorage`](/reference/javascript/auth/types/client-storage)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :-------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItem</span> | <code>(\_key: string, \_value: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItem</span> | <code>(key: string) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>removeItem</span> | <code>(key: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>set</span> | <code>(options: { key: string, value: string }) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>get</span> | <code>(options: { key: string }) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>remove</span> | <code>(options: { key: string }) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItemAsync</span> | <code>(key: string, value: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItemAsync</span> | <code>(key: string) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>deleteItemAsync</span> | <code>(key: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customGet</span> | <code>(key: string) => null | string | Promise<null | string></code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customSet</span> | <code>(key: string, value: null | string) => void | Promise<void></code> | | |
|
||||
|
||||
---
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
title: postFetch()
|
||||
sidebarTitle: postFetch()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">url</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">body</span>** <span className="optional-status">required</span> <code>any</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">token</span>** <span className="optional-status">optional</span> <code>null | string</code>
|
||||
|
||||
---
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: removeParameterFromWindow()
|
||||
sidebarTitle: removeParameterFromWindow()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">name</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
@@ -1,24 +0,0 @@
|
||||
---
|
||||
title: resetPasswordPromise()
|
||||
sidebarTitle: resetPasswordPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter<ResetPasswordContext, any, { type: "REQUEST", email: string, options: ResetPasswordOptions } | { type: "SUCCESS" } | { type: "ERROR", error: null | AuthErrorPayload }, { value: any, context: ResetPasswordContext }, ResolveTypegenMeta<Typegen0, { type: "REQUEST", email: string, options: ResetPasswordOptions } | { type: "SUCCESS" } | { type: "ERROR", error: null | AuthErrorPayload }, BaseActionObject, ResetPasswordServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`ResetPasswordOptions`](/reference/javascript/auth/types/reset-password-options)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :--------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
|
||||
|
||||
---
|
||||
@@ -1,25 +0,0 @@
|
||||
---
|
||||
title: rewriteRedirectTo()
|
||||
sidebarTitle: rewriteRedirectTo()
|
||||
---
|
||||
|
||||
Transform options that include a redirectTo property so the
|
||||
redirect url is absolute, given a base clientUrl.
|
||||
If no client url is given, any relative redirectUrl is removed while
|
||||
the other options are sent as-is.
|
||||
|
||||
**`@returns`**
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">clientUrl</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||
|
||||
base client url
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> <code>T</code>
|
||||
|
||||
---
|
||||
@@ -1,24 +0,0 @@
|
||||
---
|
||||
title: sendVerificationEmailPromise()
|
||||
sidebarTitle: sendVerificationEmailPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter<SendVerificationEmailContext, any, { type: "REQUEST", email: string, options: SendVerificationEmailOptions } | { type: "SUCCESS" } | { type: "ERROR", error: null | AuthErrorPayload }, { value: any, context: SendVerificationEmailContext }, ResolveTypegenMeta<Typegen0, { type: "REQUEST", email: string, options: SendVerificationEmailOptions } | { type: "SUCCESS" } | { type: "ERROR", error: null | AuthErrorPayload }, BaseActionObject, SendVerificationEmailServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`SendVerificationEmailOptions`](/reference/javascript/auth/types/send-verification-email-options)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :--------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
|
||||
|
||||
---
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: signInAnonymousPromise()
|
||||
sidebarTitle: signInAnonymousPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter<AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices>></code>
|
||||
|
||||
---
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
title: signInEmailPasswordPromise()
|
||||
sidebarTitle: signInEmailPasswordPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter<AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
@@ -1,29 +0,0 @@
|
||||
---
|
||||
title: signInEmailPasswordlessPromise()
|
||||
sidebarTitle: signInEmailPasswordlessPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter<AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`PasswordlessOptions`](/reference/javascript/auth/types/passwordless-options)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :----------------------------------------------------------------------------------------------- | :----------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>metadata</span> | <code>Record<string, unknown></code> | | Custom additional user information stored in the `metadata` column. Can be any JSON object. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>displayName</span> | <code>string</code> | | Display name of the user. If not provided, it will use the display name given by the social provider (Oauth) used on registration, or the email address otherwise. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>defaultRole</span> | <code>string</code> | | Default role of the user. Must be part of the default allowed roles defined in Hasura Auth. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>allowedRoles</span> | <code>Array<string></code> | | Allowed roles of the user. Must be a subset of the default allowed roles defined in Hasura Auth. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>locale</span> | <code>string</code> | | Locale of the user, in two digits |
|
||||
|
||||
---
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
title: signInEmailSecurityKeyPromise()
|
||||
sidebarTitle: signInEmailSecurityKeyPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter<AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
title: signInMfaTotpPromise()
|
||||
sidebarTitle: signInMfaTotpPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter<AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">otp</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">ticket</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||
|
||||
---
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
title: signInPATPromise()
|
||||
sidebarTitle: signInPATPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter<AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">pat</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
title: signInSmsPasswordlessOtpPromise()
|
||||
sidebarTitle: signInSmsPasswordlessOtpPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter<AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">phoneNumber</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">otp</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
@@ -1,29 +0,0 @@
|
||||
---
|
||||
title: signInSmsPasswordlessPromise()
|
||||
sidebarTitle: signInSmsPasswordlessPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter<AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">phoneNumber</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`PasswordlessOptions`](/reference/javascript/auth/types/passwordless-options)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :----------------------------------------------------------------------------------------------- | :----------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>locale</span> | <code>string</code> | | Locale of the user, in two digits |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>allowedRoles</span> | <code>Array<string></code> | | Allowed roles of the user. Must be a subset of the default allowed roles defined in Hasura Auth. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>defaultRole</span> | <code>string</code> | | Default role of the user. Must be part of the default allowed roles defined in Hasura Auth. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>displayName</span> | <code>string</code> | | Display name of the user. If not provided, it will use the display name given by the social provider (Oauth) used on registration, or the email address otherwise. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>metadata</span> | <code>Record<string, unknown></code> | | Custom additional user information stored in the `metadata` column. Can be any JSON object. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
|
||||
|
||||
---
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
title: signOutPromise()
|
||||
sidebarTitle: signOutPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter<AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">all</span>** <span className="optional-status">optional</span> <code>boolean</code>
|
||||
|
||||
---
|
||||
@@ -1,33 +0,0 @@
|
||||
---
|
||||
title: signUpEmailPasswordPromise()
|
||||
sidebarTitle: signUpEmailPasswordPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter<AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`SignUpOptions`](/reference/javascript/auth/types/sign-up-options)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :----------------------------------------------------------------------------------------------- | :----------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>metadata</span> | <code>Record<string, unknown></code> | | Custom additional user information stored in the `metadata` column. Can be any JSON object. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>displayName</span> | <code>string</code> | | Display name of the user. If not provided, it will use the display name given by the social provider (Oauth) used on registration, or the email address otherwise. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>defaultRole</span> | <code>string</code> | | Default role of the user. Must be part of the default allowed roles defined in Hasura Auth. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>allowedRoles</span> | <code>Array<string></code> | | Allowed roles of the user. Must be a subset of the default allowed roles defined in Hasura Auth. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>locale</span> | <code>string</code> | | Locale of the user, in two digits |
|
||||
|
||||
---
|
||||
@@ -1,30 +0,0 @@
|
||||
---
|
||||
title: signUpEmailSecurityKeyPromise()
|
||||
sidebarTitle: signUpEmailSecurityKeyPromise()
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter<AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } | { type: "TRY_TOKEN", token: string } | { type: "SIGNIN_ANONYMOUS" } | { type: "SIGNIN_PAT", pat: string } | { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } | { type: "SIGNIN_PASSWORD", email: string, password: string } | { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } | { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } | { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } | { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } | { type: "SIGNOUT", all: boolean } | { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } | { type: "SIGNED_IN" } | { type: "SIGNED_OUT" } | { type: "TOKEN_CHANGED" } | { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`SignUpSecurityKeyOptions`](/reference/javascript/auth/types/sign-up-security-key-options)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :----------------------------------------------------------------------------------------------- | :----------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>nickname</span> | <code>string</code> | | Optional nickname for the security key |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>metadata</span> | <code>Record<string, unknown></code> | | Custom additional user information stored in the `metadata` column. Can be any JSON object. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>displayName</span> | <code>string</code> | | Display name of the user. If not provided, it will use the display name given by the social provider (Oauth) used on registration, or the email address otherwise. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>defaultRole</span> | <code>string</code> | | Default role of the user. Must be part of the default allowed roles defined in Hasura Auth. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>allowedRoles</span> | <code>Array<string></code> | | Allowed roles of the user. Must be a subset of the default allowed roles defined in Hasura Auth. |
|
||||
| <span className="parameter-name"><span className="light-grey">options.</span>locale</span> | <code>string</code> | | Locale of the user, in two digits |
|
||||
|
||||
---
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: AuthCookieClient
|
||||
sidebarTitle: AuthCookieClient
|
||||
description: No description provided.
|
||||
---
|
||||
|
||||
|
||||
23
docs/reference/javascript/auth/connect-provider.mdx
Normal file
23
docs/reference/javascript/auth/connect-provider.mdx
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
title: connectProvider()
|
||||
sidebarTitle: connectProvider()
|
||||
---
|
||||
|
||||
Use `nhost.auth.connectProvider` to connect a social authentication provider to an existing user account
|
||||
|
||||
```ts
|
||||
nhost.auth.connectProvider({
|
||||
provider: 'github
|
||||
options: {
|
||||
redirectTo: window.location.href
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`SignInWithProviderParams`](/reference/javascript/auth/types/sign-in-with-provider-params)
|
||||
|
||||
---
|
||||
@@ -7,7 +7,7 @@ Use `nhost.auth.getHasuraClaim` to get the value of a specific Hasura claim of t
|
||||
|
||||
```ts
|
||||
// if `x-hasura-company-id` exists as a custom claim
|
||||
const companyId = nhost.auth.getHsauraClaim('company-id')
|
||||
const companyId = nhost.auth.getHasuraClaim('company-id')
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
@@ -3,8 +3,20 @@ title: getSession()
|
||||
sidebarTitle: getSession()
|
||||
---
|
||||
|
||||
Use `nhost.auth.getSession()` to get the session of the user.
|
||||
## Parameters
|
||||
|
||||
```ts
|
||||
const session = nhost.auth.getSession()
|
||||
```
|
||||
---
|
||||
|
||||
**<span className="parameter-name">context</span>** <span className="optional-status">optional</span> [`AuthContext`](/reference/javascript/auth/types/auth-context)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------- | :------: | :------------------------------------------------------------------------------------------------- |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>errors</span> | <code>Partial<Record<StateErrorTypes, AuthErrorPayload>></code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>importTokenAttempts</span> | <code>number</code> | ✔️ | Number of times the user tried to get an access token from a refresh token but got a network error |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>refreshToken</span> | <code>{ value: string | null, isPAT: boolean }</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>refreshTimer</span> | <code>{ startedAt: Date | null, attempts: number, lastAttempt: Date | null }</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>accessToken</span> | <code>{ value: string | null, expiresAt: Date | null, expiresInSeconds: number | null }</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>mfa</span> | <code>{ ticket: string } | null</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>user</span> | <code>[`User`](/reference/javascript/auth/types/user) | null</code> | ✔️ | |
|
||||
|
||||
---
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: HasuraAuthClient
|
||||
sidebarTitle: Auth
|
||||
description: No description provided.
|
||||
---
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ Note: The Nhost client automatically refreshes the session when the user is auth
|
||||
|
||||
```ts
|
||||
// Refresh the session with the the current internal refresh token.
|
||||
nhost.auth.refreshSession()
|
||||
nhost.auth.refreshToken()
|
||||
|
||||
// Refresh the session with an external refresh token.
|
||||
nhost.auth.refreshSession(refreshToken)
|
||||
nhost.auth.refreshToken(refreshToken)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
@@ -46,3 +46,7 @@ Redirection path in the client application that will be used in the link in the
|
||||
For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">connect</span>** <span className="optional-status">optional</span> <code>boolean</code>
|
||||
|
||||
---
|
||||
|
||||
@@ -36,6 +36,7 @@ https://hasura.io/docs/1.0/graphql/core/auth/authentication/jwt.html#the-spec
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :---------------------------------------------------------------------------------------------------------------------------------- | :------------------------------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">https://hasura.io/jwt/claims.</span>x-hasura-auth-elevated</span> | <code>string</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">https://hasura.io/jwt/claims.</span>x-hasura-user-is-anonymous</span> | <code>string</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">https://hasura.io/jwt/claims.</span>x-hasura-user-id</span> | <code>string</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">https://hasura.io/jwt/claims.</span>x-hasura-default-role</span> | <code>string</code> | ✔️ | |
|
||||
|
||||
@@ -10,6 +10,10 @@ description: No description provided.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">x-hasura-auth-elevated</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">x-hasura-user-is-anonymous</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
@@ -47,6 +47,10 @@ For instance, if you want to redirect to `https://myapp.com/success`, the `redir
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">connect</span>** <span className="optional-status">optional</span> <code>boolean</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">connection</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
@@ -47,6 +47,10 @@ For instance, if you want to redirect to `https://myapp.com/success`, the `redir
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">connect</span>** <span className="optional-status">optional</span> <code>boolean</code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">connection</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||
|
||||
---
|
||||
|
||||
@@ -23,6 +23,12 @@ const providerLink = useProviderLink()
|
||||
const providerLink = useProviderLink()
|
||||
```
|
||||
|
||||
Pass in the `connect` option to connect the user's account to the OAuth provider when different emails are used.
|
||||
|
||||
```js
|
||||
const providerLink = useProviderLink({ connect: true })
|
||||
```
|
||||
|
||||
```jsx
|
||||
import { useProviderLink } from '@nhost/react'
|
||||
|
||||
|
||||
@@ -23,6 +23,12 @@ const providerLink = useProviderLink()
|
||||
const providerLink = useProviderLink()
|
||||
```
|
||||
|
||||
Pass in the `connect` option to connect the user's account to the OAuth provider when different emails are used.
|
||||
|
||||
```js
|
||||
const providerLink = useProviderLink({ connect: true })
|
||||
```
|
||||
|
||||
```jsx
|
||||
import { useProviderLink } from '@nhost/vue'
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost-examples/cli
|
||||
|
||||
## 0.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/nhost-js@3.0.11
|
||||
|
||||
## 0.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/cli",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"main": "src/index.mjs",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost-examples/codegen-react-apollo
|
||||
|
||||
## 0.4.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.4.1
|
||||
- @nhost/react-apollo@11.0.1
|
||||
|
||||
## 0.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/codegen-react-apollo",
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"codegen": "graphql-codegen",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost-examples/codegen-react-query
|
||||
|
||||
## 0.4.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.4.1
|
||||
|
||||
## 0.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/codegen-react-query",
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"codegen": "graphql-codegen",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost-examples/react-urql
|
||||
|
||||
## 0.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.4.1
|
||||
- @nhost/react-urql@8.0.1
|
||||
|
||||
## 0.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@nhost-examples/codegen-react-urql",
|
||||
"private": true,
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost-examples/multi-tenant-one-to-many
|
||||
|
||||
## 2.2.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/nhost-js@3.0.11
|
||||
|
||||
## 2.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@nhost-examples/multi-tenant-one-to-many",
|
||||
"private": true,
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.1",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {},
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @nhost-examples/nextjs
|
||||
|
||||
## 0.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.4.1
|
||||
- @nhost/react-apollo@11.0.1
|
||||
- @nhost/nextjs@2.1.10
|
||||
|
||||
## 0.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/nextjs",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost-examples/node-storage
|
||||
|
||||
## 0.2.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/nhost-js@3.0.11
|
||||
|
||||
## 0.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/node-storage",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"private": true,
|
||||
"description": "This is an example of how to use the Storage with Node.js",
|
||||
"main": "src/index.mjs",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost-examples/nextjs-server-components
|
||||
|
||||
## 0.4.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/nhost-js@3.0.11
|
||||
|
||||
## 0.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/nextjs-server-components",
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost-examples/react-apollo
|
||||
|
||||
## 0.8.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.4.1
|
||||
- @nhost/react-apollo@11.0.1
|
||||
|
||||
## 0.8.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/react-apollo",
|
||||
"version": "0.8.0",
|
||||
"version": "0.8.1",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.9.9",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost-examples/react-gqty
|
||||
|
||||
## 1.2.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.4.1
|
||||
|
||||
## 1.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@nhost-examples/react-gqty",
|
||||
"private": true,
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @nhost-examples/vue-apollo
|
||||
|
||||
## 0.6.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/nhost-js@3.0.11
|
||||
- @nhost/apollo@6.2.1
|
||||
- @nhost/vue@2.5.1
|
||||
|
||||
## 0.6.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@nhost-examples/vue-apollo",
|
||||
"private": true,
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.1",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost-examples/vue-quickstart
|
||||
|
||||
## 0.2.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/apollo@6.2.1
|
||||
- @nhost/vue@2.5.1
|
||||
|
||||
## 0.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/vue-quickstart",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost/apollo
|
||||
|
||||
## 6.2.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/nhost-js@3.0.11
|
||||
|
||||
## 6.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/apollo",
|
||||
"version": "6.2.0",
|
||||
"version": "6.2.1",
|
||||
"description": "Nhost Apollo Client library",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost/react-apollo
|
||||
|
||||
## 11.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/apollo@6.2.1
|
||||
- @nhost/react@3.4.1
|
||||
|
||||
## 11.0.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/react-apollo",
|
||||
"version": "11.0.0",
|
||||
"version": "11.0.1",
|
||||
"description": "Nhost React Apollo client",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost/react-urql
|
||||
|
||||
## 8.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.4.1
|
||||
|
||||
## 8.0.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/react-urql",
|
||||
"version": "8.0.0",
|
||||
"version": "8.0.1",
|
||||
"description": "Nhost React URQL client",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost/hasura-auth-js
|
||||
|
||||
## 2.4.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- bcd889b: fix: change expiresAt format to RFC3339 in createPATPromise
|
||||
|
||||
## 2.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/hasura-auth-js",
|
||||
"version": "2.4.0",
|
||||
"version": "2.4.1",
|
||||
"description": "Hasura-auth client",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -39,7 +39,7 @@ export const createPATPromise = async (
|
||||
try {
|
||||
const { data } = await postFetch<PersonalAccessTokenCreationResponse>(
|
||||
`${backendUrl}/pat`,
|
||||
{ expiresAt: expiresAt.toUTCString(), metadata },
|
||||
{ expiresAt: expiresAt.toISOString(), metadata },
|
||||
interpreter?.getSnapshot().context.accessToken.value
|
||||
)
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost/nextjs
|
||||
|
||||
## 2.1.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.4.1
|
||||
|
||||
## 2.1.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/nextjs",
|
||||
"version": "2.1.9",
|
||||
"version": "2.1.10",
|
||||
"description": "Nhost NextJS library",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost/nhost-js
|
||||
|
||||
## 3.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [bcd889b]
|
||||
- @nhost/hasura-auth-js@2.4.1
|
||||
|
||||
## 3.0.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/nhost-js",
|
||||
"version": "3.0.10",
|
||||
"version": "3.0.11",
|
||||
"description": "Nhost JavaScript SDK",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost/react
|
||||
|
||||
## 3.4.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/nhost-js@3.0.11
|
||||
|
||||
## 3.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/react",
|
||||
"version": "3.4.0",
|
||||
"version": "3.4.1",
|
||||
"description": "Nhost React library",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -17,6 +17,14 @@ import { useAccessToken } from './useAccessToken'
|
||||
* ```
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* Pass in the `connect` option to connect the user's account to the OAuth provider when different emails are used.
|
||||
*
|
||||
* ```js
|
||||
* const providerLink = useProviderLink({ connect: true });
|
||||
* ```
|
||||
*
|
||||
* @example
|
||||
* ```jsx
|
||||
* import { useProviderLink } from '@nhost/react';
|
||||
*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user