Compare commits

..
Author SHA1 Message Date
github-actions[bot]GitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
0a07d7a248 Version Packages (#521)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-28 21:52:12 -08:00
Adam MajmudarandGitHub 8c81ca5c30 Update react-core dependencies (#520) 2023-01-29 05:25:55 +00:00
17 changed files with 75 additions and 26 deletions
+6
View File
@@ -1,5 +1,11 @@
# @thirdweb-dev/auth
## 3.0.1
### Patch Changes
- [#520](https://github.com/thirdweb-dev/js/pull/520) [`8c81ca5`](https://github.com/thirdweb-dev/js/commit/8c81ca5c3033b04b1f64e3a1134a72e7e3ec03b1) Thanks [@adam-maj](https://github.com/adam-maj)! - Update auth and react-core dependencies
## 3.0.0
### Major Changes
+2 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/auth",
"version": "3.0.0",
"version": "3.0.1",
"main": "dist/thirdweb-dev-auth.cjs.js",
"module": "dist/thirdweb-dev-auth.esm.js",
"exports": {
@@ -138,7 +138,6 @@
"dependencies": {
"cookie": "^0.5.0",
"uuid": "^9.0.0",
"yarn": "^1.22.19",
"zod": "^3.20.2"
}
}
}
+3 -3
View File
@@ -56,11 +56,11 @@ export default async function handler(
token = await ctx.auth.generate(payload, generateOptions);
} catch (err: any) {
if (err.message) {
return res.status(403).json({ error: err.message });
return res.status(400).json({ error: err.message });
} else if (typeof err === "string") {
return res.status(403).json({ error: err });
return res.status(400).json({ error: err });
} else {
return res.status(403).json({ error: "Invalid login payload" });
return res.status(400).json({ error: "Invalid login payload" });
}
}
+3 -3
View File
@@ -56,11 +56,11 @@ export default async function handler(
token = await ctx.auth.generate(payload, generateOptions);
} catch (err: any) {
if (err.message) {
return res.status(403).json({ error: err.message });
return res.status(400).json({ error: err.message });
} else if (typeof err === "string") {
return res.status(403).json({ error: err });
return res.status(400).json({ error: err });
} else {
return res.status(403).json({ error: "Invalid login payload" });
return res.status(400).json({ error: "Invalid login payload" });
}
}
+7
View File
@@ -1,5 +1,12 @@
# thirdweb
## 0.9.12
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/sdk@3.7.1
## 0.9.11
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "thirdweb",
"main": "dist/cli/index.js",
"version": "0.9.11",
"version": "0.9.12",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/cli",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
+9
View File
@@ -1,5 +1,14 @@
# @thirdweb-dev/react-core
## 3.7.1
### Patch Changes
- [#520](https://github.com/thirdweb-dev/js/pull/520) [`8c81ca5`](https://github.com/thirdweb-dev/js/commit/8c81ca5c3033b04b1f64e3a1134a72e7e3ec03b1) Thanks [@adam-maj](https://github.com/adam-maj)! - Update auth and react-core dependencies
- Updated dependencies [[`8c81ca5`](https://github.com/thirdweb-dev/js/commit/8c81ca5c3033b04b1f64e3a1134a72e7e3ec03b1)]:
- @thirdweb-dev/auth@3.0.1
## 3.7.0
### Minor Changes
+3 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react-core",
"version": "3.7.0",
"version": "3.7.1",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-core",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
@@ -80,13 +80,13 @@
},
"dependencies": {
"@tanstack/react-query": "^4.0.10",
"tiny-invariant": "^1.2.0"
"tiny-invariant": "^1.2.0",
"@thirdweb-dev/auth": "*"
},
"peerDependencies": {
"@solana/wallet-adapter-react": "^0.15.19",
"@solana/web3.js": "^1.62.0",
"@thirdweb-dev/sdk": "*",
"@thirdweb-dev/auth": "*",
"ethers": ">=5.5.1",
"react": ">=18.0.0"
},
@@ -100,9 +100,6 @@
},
"@solana/wallet-adapter-react": {
"optional": true
},
"@thirdweb-dev/auth": {
"optional": true
}
}
}
@@ -25,7 +25,7 @@ export function useLogin() {
invariant(authConfig.auth, "You need a connected wallet to login.");
const payload = await authConfig.auth.login(options);
await fetch(`${authConfig.authUrl}/login`, {
const res = await fetch(`${authConfig.authUrl}/login`, {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -33,6 +33,15 @@ export function useLogin() {
body: JSON.stringify({ payload }),
});
if (!res.ok) {
const data = await res.json();
if (data.error) {
throw new Error(data.error);
}
throw new Error(`Login request failed with status code ${res.status}`);
}
queryClient.invalidateQueries(cacheKeys.auth.user());
},
});
@@ -37,7 +37,7 @@ export function useLogin() {
invariant(authConfig.auth, "You need a connected wallet to login.");
const payload = await authConfig.auth.login(options);
await fetch(`${authConfig.authUrl}/login`, {
const res = await fetch(`${authConfig.authUrl}/login`, {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -45,6 +45,15 @@ export function useLogin() {
body: JSON.stringify({ payload }),
});
if (!res.ok) {
const data = await res.json();
if (data.error) {
throw new Error(data.error);
}
throw new Error(`Login request failed with status code ${res.status}`);
}
queryClient.invalidateQueries(ensureTWPrefix(["user"]));
},
});
+9
View File
@@ -1,5 +1,14 @@
# @thirdweb-dev/react
## 3.7.1
### Patch Changes
- [#520](https://github.com/thirdweb-dev/js/pull/520) [`8c81ca5`](https://github.com/thirdweb-dev/js/commit/8c81ca5c3033b04b1f64e3a1134a72e7e3ec03b1) Thanks [@adam-maj](https://github.com/adam-maj)! - Update auth and react-core dependencies
- Updated dependencies [[`8c81ca5`](https://github.com/thirdweb-dev/js/commit/8c81ca5c3033b04b1f64e3a1134a72e7e3ec03b1)]:
- @thirdweb-dev/react-core@3.7.1
## 3.7.0
### Minor Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react",
"version": "3.7.0",
"version": "3.7.1",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
+2
View File
@@ -1,5 +1,7 @@
# @thirdweb-dev/sdk
## 3.7.1
## 3.7.0
### Minor Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/sdk",
"version": "3.7.0",
"version": "3.7.1",
"description": "The main thirdweb SDK.",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/sdk",
"license": "Apache-2.0",
+7
View File
@@ -1,5 +1,12 @@
# @thirdweb-dev/unity-js-bridge
## 0.2.1
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/sdk@3.7.1
## 0.2.0
### Minor Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/unity-js-bridge",
"version": "0.2.0",
"version": "0.2.1",
"main": "dist/thirdweb-unity-bridge.js",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/unity-js-bridge",
"license": "Apache-2.0",
-5
View File
@@ -21067,11 +21067,6 @@ yargs@^17.1.1, yargs@^17.3.0, yargs@^17.3.1:
y18n "^5.0.5"
yargs-parser "^21.1.1"
yarn@^1.22.19:
version "1.22.19"
resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.19.tgz#4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
integrity sha512-/0V5q0WbslqnwP91tirOvldvYISzaqhClxzyUKXYxs07yUILIs5jx/k6CFe8bvKSkds5w+eiOqta39Wk3WxdcQ==
[email protected]:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"