Compare commits
55 Commits
@nhost/rea
...
@nhost/rea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5cc9be00b6 | ||
|
|
28dae23a91 | ||
|
|
7819e20cf4 | ||
|
|
6be3758668 | ||
|
|
658c67faf4 | ||
|
|
1bcee357fe | ||
|
|
b729aa9290 | ||
|
|
57780ee645 | ||
|
|
aad8d22380 | ||
|
|
85d33c4de0 | ||
|
|
ab3e2dcee9 | ||
|
|
12f4504b61 | ||
|
|
71d7a11c96 | ||
|
|
16a6c5073e | ||
|
|
3fcc86792a | ||
|
|
27909128e4 | ||
|
|
9b840f7c4a | ||
|
|
47c57ff665 | ||
|
|
1cb330016b | ||
|
|
497652d1b4 | ||
|
|
20eb7aa381 | ||
|
|
4a3c2f92b1 | ||
|
|
5647e64265 | ||
|
|
c113debf46 | ||
|
|
3f0ae4a58c | ||
|
|
3d5b8183e8 | ||
|
|
789ef8f783 | ||
|
|
94df175ca3 | ||
|
|
c8bcefb0e5 | ||
|
|
fc52f59eb8 | ||
|
|
a80389e5c7 | ||
|
|
923276422b | ||
|
|
7c9192f3a0 | ||
|
|
51d139b7aa | ||
|
|
8fe1bdb6f7 | ||
|
|
5b288bc0d1 | ||
|
|
27cd769c76 | ||
|
|
5bb370869d | ||
|
|
ec68f64db4 | ||
|
|
4cf8f146c9 | ||
|
|
61cf317541 | ||
|
|
a2066c9b41 | ||
|
|
817b152704 | ||
|
|
cc73494c91 | ||
|
|
64ed4083b9 | ||
|
|
77e8c58cc6 | ||
|
|
0cd2eab309 | ||
|
|
7d8c843c74 | ||
|
|
da1c2d6914 | ||
|
|
3a949301f9 | ||
|
|
585eebab49 | ||
|
|
45c3e4686e | ||
|
|
52f2e67952 | ||
|
|
929774aa5b | ||
|
|
e711e338e7 |
20
.github/workflows/changesets.yaml
vendored
20
.github/workflows/changesets.yaml
vendored
@@ -16,15 +16,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# - name: Cache pnpm modules
|
||||
# uses: actions/cache@v2
|
||||
# with:
|
||||
# path: ~/.pnpm-store
|
||||
# key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
# restore-keys: |
|
||||
# ${{ runner.os }}-
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: pnpm/action-setup@v2.1.0
|
||||
with:
|
||||
@@ -35,16 +30,19 @@ jobs:
|
||||
with:
|
||||
node-version: '17.8.0'
|
||||
cache: 'pnpm'
|
||||
- name: Pick the right npm version
|
||||
# * See: https://github.com/pnpm/pnpm/issues/4348
|
||||
run: npm install --global npm@8.4
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
- name: Create PR or Publish release
|
||||
id: changesets
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
version: pnpm ci:version
|
||||
version: pnpm run ci:version
|
||||
commit: 'chore: update versions'
|
||||
title: 'chore: update versions'
|
||||
publish: pnpm release
|
||||
publish: pnpm run release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
@@ -45,10 +45,10 @@ title: Environment Variables
|
||||
| AUTH_SMS_TWILIO_FROM | | |
|
||||
| AUTH_EMAIL_SIGNIN_EMAIL_VERIFIED_REQUIRED | When enabled, any email-based authentication requires emails to be verified by a link sent to this email. | `true` |
|
||||
| AUTH_ACCESS_CONTROL_ALLOWED_REDIRECT_URLS | | |
|
||||
| AUTH_MFA_ENABLED | Enables users to use Multi Factor Authentication | `false` |
|
||||
| AUTH_MFA_ENABLED | Enables users to use Multi Factor Authentication. | `false` |
|
||||
| AUTH_MFA_TOTP_ISSUER | The name of the One Time Password (OTP) issuer. Probably your app's name. | `hasura-auth` |
|
||||
| AUTH_ACCESS_TOKEN_EXPIRES_IN | | `900`(15 minutes) |
|
||||
| AUTH_REFRESH_TOKEN_EXPIRES_IN | | `43200` (12 hours) |
|
||||
| AUTH_ACCESS_TOKEN_EXPIRES_IN | Number of seconds before the access token (JWT) expires. | `900`(15 minutes) |
|
||||
| AUTH_REFRESH_TOKEN_EXPIRES_IN | Number of seconds before the refresh token expires. | `2592000` (30 days) |
|
||||
| AUTH_EMAIL_TEMPLATE_FETCH_URL | | |
|
||||
| AUTH_JWT_CUSTOM_CLAIMS | | |
|
||||
|
||||
|
||||
@@ -28,11 +28,11 @@
|
||||
"prettier:fix": "prettier --write .",
|
||||
"lint": "pnpm turbo run lint --stream",
|
||||
"lint:fix": "pnpm turbo run lint:fix --stream",
|
||||
"test": "pnpm turbo run test --scope='@nhost/*' --no-deps --include-dependencies",
|
||||
"prerelease": "pnpm clean && pnpm install && pnpm build",
|
||||
"release": "pnpm run prerelease && changeset publish && git push --follow-tags && git status && pnpm -r publish",
|
||||
"changeset": "changeset",
|
||||
"release": "pnpm run prerelease && changeset publish",
|
||||
"snapshot": "pnpm prerelease && changeset version --snapshot preview && pnpm install && changeset publish --tag preview",
|
||||
"test": "pnpm turbo run test --scope='@nhost/*' --no-deps --include-dependencies",
|
||||
"changeset": "changeset",
|
||||
"wait": "wait-on http://localhost:1337/v1/auth/healthz -i 500 -t 120000"
|
||||
},
|
||||
"workspaces": [
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
# @nhost/apollo
|
||||
|
||||
## 0.3.2
|
||||
## 0.3.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [16a6c50]
|
||||
- @nhost/core@0.3.4
|
||||
|
||||
## 0.3.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/apollo",
|
||||
"version": "0.3.2",
|
||||
"version": "0.3.6",
|
||||
"description": "Nhost Apollo Client library",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
# @nhost/core
|
||||
|
||||
## 0.3.2
|
||||
## 0.3.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 16a6c50: Correct autoSignIn
|
||||
|
||||
## 0.3.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/core",
|
||||
"version": "0.3.2",
|
||||
"version": "0.3.7",
|
||||
"description": "Nhost core client library",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -634,26 +634,31 @@ export const createAuthMachine = ({
|
||||
options: rewriteRedirectTo(clientUrl, options)
|
||||
}),
|
||||
|
||||
/**
|
||||
* If autoSignIn is enabled, attempts to get the refreshToken from the current location's hash
|
||||
* @returns
|
||||
*/
|
||||
autoSignIn: async () => {
|
||||
// TODO throwing errors is not really important as they are captured by the xstate invoker
|
||||
// * Still, keep them for the moment as it needs to be tested in every environemnt e.g. nodejs, expo, react-native...
|
||||
if (typeof window === 'undefined' || !window.location)
|
||||
throw Error('window is undefined or location does not exist')
|
||||
const { hash } = window.location
|
||||
if (!hash) return
|
||||
if (!hash) throw Error('No hash in window.location')
|
||||
const params = new URLSearchParams(hash.slice(1))
|
||||
const refreshToken = params.get('refreshToken')
|
||||
if (refreshToken) {
|
||||
const session = await postRequest('/token', {
|
||||
refreshToken
|
||||
})
|
||||
// * remove hash from the current url after consumming the token
|
||||
// TODO remove the hash. For the moment, it is kept to avoid regression from the current SDK.
|
||||
// * Then, only `refreshToken` will be in the hash, while `type` will be sent by hasura-auth as a query parameter
|
||||
// window.history.pushState({}, '', location.pathname)
|
||||
const channel = new BroadcastChannel('nhost')
|
||||
// TODO broadcat session instead of token
|
||||
channel.postMessage(refreshToken)
|
||||
return { session }
|
||||
}
|
||||
if (!refreshToken) throw Error('No refresh token in the location hash')
|
||||
const session = await postRequest('/token', {
|
||||
refreshToken
|
||||
})
|
||||
// * remove hash from the current url after consumming the token
|
||||
// TODO remove the hash. For the moment, it is kept to avoid regression from the current SDK.
|
||||
// * Then, only `refreshToken` will be in the hash, while `type` will be sent by hasura-auth as a query parameter
|
||||
// window.history.pushState({}, '', location.pathname)
|
||||
const channel = new BroadcastChannel('nhost')
|
||||
// ? broadcat session instead of token ?
|
||||
channel.postMessage(refreshToken)
|
||||
return { session }
|
||||
},
|
||||
importRefreshToken: async () => {
|
||||
const stringExpiresAt = await clientStorageGetter(NHOST_JWT_EXPIRES_AT_KEY)
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
# @nhost/hasura-auth-js
|
||||
|
||||
## 1.0.3
|
||||
## 1.0.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 6be3758: bug: Correct OAuth provider link.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [16a6c50]
|
||||
- @nhost/core@0.3.4
|
||||
|
||||
## 1.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/hasura-auth-js",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.8",
|
||||
"description": "Hasura-auth client",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -157,7 +157,7 @@ export class HasuraAuthClient {
|
||||
if ('provider' in params) {
|
||||
const { provider, options } = params
|
||||
const providerUrl = encodeQueryParameters(
|
||||
`${this.#client.backendUrl}/v1/auth/signin/provider/${provider}`,
|
||||
`${this.#client.backendUrl}/signin/provider/${provider}`,
|
||||
rewriteRedirectTo(this.#client.clientUrl, options)
|
||||
)
|
||||
if (isBrowser()) {
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
# @nhost/nextjs
|
||||
|
||||
## 1.0.4
|
||||
## 1.0.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/nhost-js@1.0.8
|
||||
- @nhost/react@0.4.7
|
||||
|
||||
## 1.0.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/nhost-js@1.0.5
|
||||
- @nhost/react@0.4.4
|
||||
|
||||
## 1.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/nextjs",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.9",
|
||||
"description": "Nhost NextJS library",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
# @nhost/nhost-js
|
||||
|
||||
## 1.0.3
|
||||
## 1.0.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [6be3758]
|
||||
- @nhost/hasura-auth-js@1.0.8
|
||||
|
||||
## 1.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/hasura-auth-js@1.0.5
|
||||
|
||||
## 1.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/nhost-js",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.8",
|
||||
"description": "Nhost JavaScript SDK",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
# @nhost/react-apollo
|
||||
|
||||
## 4.0.4
|
||||
## 4.0.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@0.4.7
|
||||
- @nhost/apollo@0.3.6
|
||||
|
||||
## 4.0.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/apollo@0.3.4
|
||||
- @nhost/react@0.4.4
|
||||
|
||||
## 4.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/react-apollo",
|
||||
"version": "4.0.4",
|
||||
"version": "4.0.9",
|
||||
"description": "Nhost React Apollo client",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,18 @@
|
||||
# @nhost/react
|
||||
|
||||
## 0.4.2
|
||||
## 0.4.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/nhost-js@1.0.8
|
||||
|
||||
## 0.4.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/nhost-js@1.0.5
|
||||
|
||||
## 0.4.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/react",
|
||||
"version": "0.4.2",
|
||||
"version": "0.4.7",
|
||||
"description": "Nhost React library",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
Reference in New Issue
Block a user