@moreillon/vue-oidc 0.0.7 → 0.0.8
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.
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type OidcClient from "@moreillon/oidc-auth";
|
|
2
|
+
declare function login(): () => void;
|
|
3
|
+
declare function logout(): () => void;
|
|
2
4
|
export default function (): {
|
|
3
5
|
client: import("vue").Ref<{
|
|
4
6
|
cookieName: string;
|
|
@@ -73,6 +75,7 @@ export default function (): {
|
|
|
73
75
|
} | null>;
|
|
74
76
|
user: import("vue").Ref<any, any>;
|
|
75
77
|
access_token: import("vue").Ref<string | null, string | null>;
|
|
76
|
-
login:
|
|
77
|
-
logout:
|
|
78
|
+
login: typeof login;
|
|
79
|
+
logout: typeof logout;
|
|
78
80
|
};
|
|
81
|
+
export {};
|
|
@@ -2,12 +2,22 @@ import { ref } from "vue";
|
|
|
2
2
|
const client = ref(null);
|
|
3
3
|
const user = ref(null);
|
|
4
4
|
const access_token = ref(null);
|
|
5
|
+
function login() {
|
|
6
|
+
if (!client.value)
|
|
7
|
+
throw new Error("OIDC Client not instanciated");
|
|
8
|
+
return client.value.login;
|
|
9
|
+
}
|
|
10
|
+
function logout() {
|
|
11
|
+
if (!client.value)
|
|
12
|
+
throw new Error("OIDC Client not instanciated");
|
|
13
|
+
return client.value.logout;
|
|
14
|
+
}
|
|
5
15
|
export default function () {
|
|
6
16
|
return {
|
|
7
17
|
client,
|
|
8
18
|
user,
|
|
9
19
|
access_token,
|
|
10
|
-
login
|
|
11
|
-
logout
|
|
20
|
+
login,
|
|
21
|
+
logout,
|
|
12
22
|
};
|
|
13
23
|
}
|