Compare commits

...

57 Commits

Author SHA1 Message Date
Pilou
5cc9be00b6 Merge pull request #341 from nhost/changeset-release/main
chore: update versions
2022-04-05 16:14:26 +02:00
github-actions[bot]
28dae23a91 chore: update versions 2022-04-05 14:02:46 +00:00
Pilou
7819e20cf4 Merge pull request #340 from nhost/elitan-patch-1
Correct OAuth provider link
2022-04-05 16:01:42 +02:00
Johan Eliasson
6be3758668 Create ninety-eels-lick.md 2022-04-05 15:56:18 +02:00
Johan Eliasson
658c67faf4 Update hasura-auth-client.ts 2022-04-05 15:54:39 +02:00
Pilou
1bcee357fe Merge pull request #325 from nhost/docs/auth-refresh-expiration
docs: change default refresh token expiration to 30 days
2022-04-03 22:32:21 +02:00
Pierre-Louis Mercereau
b729aa9290 ci: fix pnpm/npm/changeset 2022-04-03 22:26:58 +02:00
Pilou
57780ee645 Merge pull request #333 from nhost/changeset-release/main
chore: update versions
2022-04-03 15:35:58 +02:00
github-actions[bot]
aad8d22380 chore: update versions 2022-04-03 13:28:59 +00:00
Pilou
85d33c4de0 Merge pull request #332 from nhost/fix/auto-signin
fix: correct auto-signin bug introducted in previous version
2022-04-03 15:28:16 +02:00
Pierre-Louis Mercereau
ab3e2dcee9 refactor: remove log 2022-04-03 15:22:11 +02:00
Pierre-Louis Mercereau
12f4504b61 refactor: remove incorrect and unused snapshot script 2022-04-03 15:19:00 +02:00
Pierre-Louis Mercereau
71d7a11c96 refactor: correct script 2022-04-03 15:11:48 +02:00
Pierre-Louis Mercereau
16a6c5073e fix: correct auto-signin bug introducted in previous version 2022-04-03 15:05:13 +02:00
Pilou
3fcc86792a Merge branch 'main' into main 2022-04-03 13:40:31 +02:00
Pierre-Louis Mercereau
27909128e4 chore: bump versions to fix the workspace/package link bug 2022-04-02 11:25:38 +02:00
Pierre-Louis Mercereau
72371c72a1 chore: bump versions 2022-04-02 10:58:56 +02:00
Pierre-Louis Mercereau
d878414b10 ci: freeze node version 2022-04-02 10:52:27 +02:00
Pierre-Louis Mercereau
9b840f7c4a docs: change default refresh token expiration to 30 days 2022-04-01 21:15:40 +02:00
Pierre-Louis Mercereau
47c57ff665 ci: scope ci script 2022-03-10 13:12:08 +01:00
Pierre-Louis Mercereau
1cb330016b ci: wrap up 2022-03-10 13:06:17 +01:00
Pierre-Louis Mercereau
497652d1b4 ci: cd, not cp 2022-03-10 13:00:22 +01:00
Pierre-Louis Mercereau
20eb7aa381 ci: correct cp 2022-03-10 12:58:54 +01:00
Pierre-Louis Mercereau
4a3c2f92b1 ci: correct cp arg 2022-03-10 12:57:38 +01:00
Pierre-Louis Mercereau
5647e64265 ci: copy existing nhost project 2022-03-10 12:55:43 +01:00
Pierre-Louis Mercereau
c113debf46 ci: again 2022-03-10 12:52:49 +01:00
Pierre-Louis Mercereau
3f0ae4a58c ci: manually create nhost project 2022-03-10 12:50:36 +01:00
Pierre-Louis Mercereau
3d5b8183e8 ci: deactivate nhost 2022-03-10 12:47:38 +01:00
Pierre-Louis Mercereau
789ef8f783 ci: exec nhost in tmp 2022-03-10 12:44:45 +01:00
Pierre-Louis Mercereau
94df175ca3 ci: remove testing project 2022-03-10 12:41:24 +01:00
Pierre-Louis Mercereau
c8bcefb0e5 ci: remove testing project 2022-03-10 12:40:20 +01:00
Pierre-Louis Mercereau
fc52f59eb8 ci: again 2022-03-10 12:37:39 +01:00
Pierre-Louis Mercereau
a80389e5c7 ci: again 2022-03-10 12:30:57 +01:00
Pierre-Louis Mercereau
923276422b ci: desesperant 2022-03-10 12:28:43 +01:00
Pierre-Louis Mercereau
7c9192f3a0 ci: correct 2022-03-10 12:24:33 +01:00
Pierre-Louis Mercereau
51d139b7aa ci: single ci command 2022-03-10 12:21:58 +01:00
Pierre-Louis Mercereau
8fe1bdb6f7 ci: deactivate cache 2022-03-10 12:19:01 +01:00
Pierre-Louis Mercereau
5b288bc0d1 ci: add options 2022-03-10 12:18:38 +01:00
Pierre-Louis Mercereau
27cd769c76 ci: frozen lockfile 2022-03-10 12:16:08 +01:00
Pierre-Louis Mercereau
5bb370869d ci: clean 2022-03-10 12:13:57 +01:00
Pierre-Louis Mercereau
ec68f64db4 ci: 1.1.5 2022-03-10 12:11:48 +01:00
Pierre-Louis Mercereau
4cf8f146c9 ci: another turbo version 2022-03-10 12:08:16 +01:00
Pierre-Louis Mercereau
61cf317541 ci: decrease pnpm version 2022-03-10 12:04:03 +01:00
Pierre-Louis Mercereau
a2066c9b41 ci: increase depth 2022-03-10 12:02:25 +01:00
Pierre-Louis Mercereau
817b152704 ci: pwd 2022-03-10 12:00:40 +01:00
Pierre-Louis Mercereau
cc73494c91 ci: installl again 2022-03-10 11:58:05 +01:00
Pierre-Louis Mercereau
64ed4083b9 ci: reverse version 2022-03-10 11:54:12 +01:00
Pierre-Louis Mercereau
77e8c58cc6 ci: downgrade turborepo 2022-03-10 11:48:33 +01:00
Pierre-Louis Mercereau
0cd2eab309 ci: debug 2022-03-10 11:43:58 +01:00
Pierre-Louis Mercereau
7d8c843c74 ci: deactivate turbo cache 2022-03-10 11:41:34 +01:00
Pierre-Louis Mercereau
da1c2d6914 ci: add src to files 2022-03-10 11:38:58 +01:00
Pierre-Louis Mercereau
3a949301f9 ci: remove scope 2022-03-10 11:34:43 +01:00
Pierre-Louis Mercereau
585eebab49 ci: updated packages 2022-03-10 11:30:05 +01:00
Pierre-Louis Mercereau
45c3e4686e ci: debug 2022-03-10 11:26:04 +01:00
Pierre-Louis Mercereau
52f2e67952 ci: install dependencies 2022-03-10 11:22:24 +01:00
Pierre-Louis Mercereau
929774aa5b ci: matrix 2022-03-10 11:21:04 +01:00
Pierre-Louis Mercereau
e711e338e7 ci: clean ci 2022-03-10 11:18:56 +01:00
19 changed files with 225 additions and 40 deletions

View File

@@ -16,29 +16,33 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache pnpm modules
uses: actions/cache@v2
- name: Checkout repository
uses: actions/checkout@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
fetch-depth: 0
- uses: pnpm/action-setup@v2.1.0
with:
version: 6.32.3
run_install: true
# run_install: true
- name: Use Node.js 17
uses: actions/setup-node@v2
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 }}

View File

@@ -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 | | |

View File

@@ -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": [

View File

@@ -1,5 +1,26 @@
# @nhost/apollo
## 0.3.5
### Patch Changes
- Updated dependencies [16a6c50]
- @nhost/core@0.3.4
## 0.3.3
### Patch Changes
- correct dependencies
See this related issues:
- [nhost](https://github.com/nhost/nhost/issues/326)
- [pnpm](https://github.com/pnpm/pnpm/issues/4348)
- Updated dependencies
- @nhost/core@0.3.2
## 0.3.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/apollo",
"version": "0.3.1",
"version": "0.3.6",
"description": "Nhost Apollo Client library",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,22 @@
# @nhost/core
## 0.3.7
### Patch Changes
- 16a6c50: Correct autoSignIn
## 0.3.3
### Patch Changes
- correct dependencies
See this related issues:
- [nhost](https://github.com/nhost/nhost/issues/326)
- [pnpm](https://github.com/pnpm/pnpm/issues/4348)
## 0.3.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/core",
"version": "0.3.1",
"version": "0.3.7",
"description": "Nhost core client library",
"license": "MIT",
"keywords": [

View File

@@ -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)

View File

@@ -1,5 +1,32 @@
# @nhost/hasura-auth-js
## 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
- correct dependencies
See this related issues:
- [nhost](https://github.com/nhost/nhost/issues/326)
- [pnpm](https://github.com/pnpm/pnpm/issues/4348)
- Updated dependencies
- @nhost/core@0.3.2
## 1.0.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/hasura-auth-js",
"version": "1.0.2",
"version": "1.0.8",
"description": "Hasura-auth client",
"license": "MIT",
"keywords": [

View File

@@ -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()) {

View File

@@ -1,5 +1,34 @@
# @nhost/nextjs
## 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
- correct dependencies
See this related issues:
- [nhost](https://github.com/nhost/nhost/issues/326)
- [pnpm](https://github.com/pnpm/pnpm/issues/4348)
- Updated dependencies
- @nhost/nhost-js@1.0.3
- @nhost/react@0.4.2
## 1.0.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nextjs",
"version": "1.0.3",
"version": "1.0.9",
"description": "Nhost NextJS library",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,32 @@
# @nhost/nhost-js
## 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
- correct dependencies
See this related issues:
- [nhost](https://github.com/nhost/nhost/issues/326)
- [pnpm](https://github.com/pnpm/pnpm/issues/4348)
- Updated dependencies
- @nhost/hasura-auth-js@1.0.3
## 1.0.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nhost-js",
"version": "1.0.2",
"version": "1.0.8",
"description": "Nhost JavaScript SDK",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,34 @@
# @nhost/react-apollo
## 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
- correct dependencies
See this related issues:
- [nhost](https://github.com/nhost/nhost/issues/326)
- [pnpm](https://github.com/pnpm/pnpm/issues/4348)
- Updated dependencies
- @nhost/apollo@0.3.2
- @nhost/react@0.4.2
## 4.0.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-apollo",
"version": "4.0.3",
"version": "4.0.9",
"description": "Nhost React Apollo client",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,31 @@
# @nhost/react
## 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
- correct dependencies
See this related issues:
- [nhost](https://github.com/nhost/nhost/issues/326)
- [pnpm](https://github.com/pnpm/pnpm/issues/4348)
- Updated dependencies
- @nhost/nhost-js@1.0.3
## 0.4.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react",
"version": "0.4.1",
"version": "0.4.7",
"description": "Nhost React library",
"license": "MIT",
"keywords": [