@logto/vue 0.1.11 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/context.js +1 -0
- package/lib/plugin.js +7 -3
- package/package.json +4 -4
package/lib/context.js
CHANGED
package/lib/plugin.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createPluginMethods = void 0;
|
|
4
4
|
const context_1 = require("./context");
|
|
5
5
|
const createPluginMethods = (context) => {
|
|
6
|
-
const { logtoClient, setLoading, setError
|
|
6
|
+
const { logtoClient, setLoading, setError } = context;
|
|
7
7
|
const signIn = async (redirectUri) => {
|
|
8
8
|
if (!logtoClient.value) {
|
|
9
9
|
return (0, context_1.throwContextError)();
|
|
@@ -26,7 +26,9 @@ const createPluginMethods = (context) => {
|
|
|
26
26
|
try {
|
|
27
27
|
setLoading(true);
|
|
28
28
|
await logtoClient.value.signOut(postLogoutRedirectUri);
|
|
29
|
-
|
|
29
|
+
// We deliberately do NOT set isAuthenticated to false here, because the app state may change immediately
|
|
30
|
+
// even before navigating to the oidc end session endpoint, which might cause rendering problems.
|
|
31
|
+
// Moreover, since the location will be redirected, the isAuthenticated state will not matter any more.
|
|
30
32
|
}
|
|
31
33
|
catch (error) {
|
|
32
34
|
setError(error, 'Unexpected error occurred while signing out.');
|
|
@@ -83,7 +85,9 @@ const createPluginMethods = (context) => {
|
|
|
83
85
|
try {
|
|
84
86
|
setLoading(true);
|
|
85
87
|
await logtoClient.value.handleSignInCallback(callbackUri);
|
|
86
|
-
|
|
88
|
+
// We deliberately do NOT set isAuthenticated to true here, because the app state may change immediately
|
|
89
|
+
// even before navigating to the return page URL, which might cause rendering problems.
|
|
90
|
+
// Moreover, since the location will be redirected, the isAuthenticated state will not matter any more.
|
|
87
91
|
window.location.assign(returnToPageUrl);
|
|
88
92
|
}
|
|
89
93
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"exports": "./lib/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"prepack": "pnpm test"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@logto/browser": "^0.1.
|
|
27
|
+
"@logto/browser": "^0.1.14"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@jest/types": "^27.5.1",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@types/jest": "^27.4.1",
|
|
34
34
|
"eslint": "^8.9.0",
|
|
35
35
|
"jest": "^27.5.1",
|
|
36
|
-
"lint-staged": "^
|
|
36
|
+
"lint-staged": "^13.0.0",
|
|
37
37
|
"postcss": "^8.4.6",
|
|
38
38
|
"prettier": "^2.5.1",
|
|
39
39
|
"stylelint": "^14.8.2",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "5d05c6bd23dc35d7217031edccc01db2bae33b7b"
|
|
65
65
|
}
|