@asgardeo/vue 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.
- package/README.md +1 -90
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,95 +8,6 @@
|
|
|
8
8
|
<a href="./LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License"></a>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
|
-
## Installation
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
# Using npm
|
|
15
|
-
npm install @asgardeo/vue
|
|
16
|
-
|
|
17
|
-
# or using pnpm
|
|
18
|
-
pnpm add @asgardeo/vue
|
|
19
|
-
|
|
20
|
-
# or using yarn
|
|
21
|
-
yarn add @asgardeo/vue
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Basic Setup
|
|
25
|
-
|
|
26
|
-
1. Configure the authentication plugin:
|
|
27
|
-
|
|
28
|
-
```typescript
|
|
29
|
-
import { createApp } from 'vue'
|
|
30
|
-
import { AsgardeoAuth } from '@asgardeo/vue'
|
|
31
|
-
|
|
32
|
-
const app = createApp(App)
|
|
33
|
-
|
|
34
|
-
app.use(AsgardeoAuth, {
|
|
35
|
-
afterSignInUrl: "http://localhost:3000",
|
|
36
|
-
afterSignOutUrl: "http://localhost:3000",
|
|
37
|
-
clientId: "<your-client-id>",
|
|
38
|
-
baseUrl: "https://api.asgardeo.io/t/<org-name>",
|
|
39
|
-
scope: ["openid", "profile"]
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
app.mount('#app')
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
2. Use in your components:
|
|
46
|
-
|
|
47
|
-
```vue
|
|
48
|
-
<template>
|
|
49
|
-
<div>
|
|
50
|
-
<div v-if="auth.isSignedIn">
|
|
51
|
-
<p>Welcome, {{ auth.user?.username }}</p>
|
|
52
|
-
<button @click="auth.signOut">Sign Out</button>
|
|
53
|
-
</div>
|
|
54
|
-
<button v-else @click="auth.signIn">Sign In</button>
|
|
55
|
-
</div>
|
|
56
|
-
</template>
|
|
57
|
-
|
|
58
|
-
<script setup>
|
|
59
|
-
import { useAsgardeo } from '@asgardeo/vue'
|
|
60
|
-
|
|
61
|
-
const auth = useAsgardeo()
|
|
62
|
-
</script>
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Composables
|
|
66
|
-
|
|
67
|
-
- `useAsgardeo()`: Main composable that provides:
|
|
68
|
-
- `isSignedIn`: Boolean indicating authentication status
|
|
69
|
-
- `user`: Current user information
|
|
70
|
-
- `signIn()`: Function to initiate sign in
|
|
71
|
-
- `signOut()`: Function to sign out
|
|
72
|
-
- `getAccessToken()`: Function to get the current access token
|
|
73
|
-
- `getUser()`: Function to get basic user information
|
|
74
|
-
|
|
75
|
-
- `useAuthContext()`: Composable to access the raw authentication context
|
|
76
|
-
- `useIsAuthenticated()`: Composable to check authentication status
|
|
77
|
-
|
|
78
|
-
## Development
|
|
79
|
-
|
|
80
|
-
1. Install dependencies:
|
|
81
|
-
```bash
|
|
82
|
-
pnpm install
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
2. Build:
|
|
86
|
-
```bash
|
|
87
|
-
pnpm build
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
3. Run tests:
|
|
91
|
-
```bash
|
|
92
|
-
pnpm test
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
4. Run development server:
|
|
96
|
-
```bash
|
|
97
|
-
pnpm dev
|
|
98
|
-
```
|
|
99
|
-
|
|
100
11
|
## License
|
|
101
12
|
|
|
102
|
-
Apache License, Version 2.0
|
|
13
|
+
Licenses this source under the Apache License, Version 2.0 [LICENSE](./LICENSE), You may not use this file except in compliance with the License.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asgardeo/vue",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Vue SDK for Asgardeo - Authentication and Identity Management",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"randombytes": "2.1.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"vue": "3.5.13"
|
|
76
|
+
"vue": ">=3.5.13"
|
|
77
77
|
},
|
|
78
78
|
"exports": {
|
|
79
79
|
"types": "./dist/index.d.ts",
|