Skip to content
This repository was archived by the owner on Jul 23, 2024. It is now read-only.

Commit ff58032

Browse files
authored
User profile widget RELEASE (#75)
1 parent ade1c6f commit ff58032

File tree

9 files changed

+329
-144
lines changed

9 files changed

+329
-144
lines changed

README.md

+32-4
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ Important Note:
252252
253253
#### User Management
254254
255-
The `UserManagement` widget will let you embed a user table in your site to view and take action.
255+
The `UserManagement` widget lets you embed a user table in your site to view and take action.
256256
257257
The widget lets you:
258258
@@ -284,7 +284,7 @@ Example:
284284
285285
#### Role Management
286286
287-
The `RoleManagement` widget will let you embed a role table in your site to view and take action.
287+
The `RoleManagement` widget lets you embed a role table in your site to view and take action.
288288
289289
The widget lets you:
290290
@@ -314,7 +314,7 @@ Example:
314314
315315
#### Access Key Management
316316
317-
The `AccessKeyManagement` widget will let you embed an access key table in your site to view and take action.
317+
The `AccessKeyManagement` widget lets you embed an access key table in your site to view and take action.
318318
319319
The widget lets you:
320320
@@ -349,7 +349,7 @@ Example:
349349
350350
#### Audit Management
351351
352-
The `AuditManagement` widget will let you embed an audit table in your site.
352+
The `AuditManagement` widget lets you embed an audit table in your site.
353353
354354
###### Usage
355355
@@ -366,6 +366,34 @@ import { AuditManagement } from '@descope/vue-sdk';
366366
Example:
367367
[Manage Audit](./example/components/ManageAudit.vue)
368368
369+
#### User Profile
370+
371+
The `UserProfile` widget lets you embed a user profile component in your app and let the logged in user update his profile.
372+
373+
The widget lets you:
374+
375+
- Update user profile picture
376+
- Update user personal information
377+
- Update authentication methods
378+
- Logout
379+
380+
###### Usage
381+
382+
```vue
383+
<template>
384+
<UserProfile widget-id="user-profile-widget" @logout="onLogout" />
385+
</template>
386+
387+
<script setup>
388+
import { UserProfile } from '@descope/vue-sdk';
389+
390+
const onLogout = () => (window.location.href = '/login');
391+
</script>
392+
```
393+
394+
Example:
395+
[User Profile](./example/components/MyUserProfile.vue)
396+
369397
## Code Example
370398
371399
You can find an example Vue app in the [example folder](./example).

example/components/App.vue

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<router-link to="/manage-roles">Manage Roles</router-link>
77
<router-link to="/manage-access-keys">Manage Access Keys</router-link>
88
<router-link to="/manage-audit">Manage Audit</router-link>
9+
<router-link to="/user-profile">User Profile</router-link>
910
<router-link to="/login">Login</router-link>
1011
</div>
1112
<button v-if="isAuthenticated" @click="logout()">Logout</button>

example/components/MyUserProfile.vue

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!-- eslint-disable vue/multi-word-component-names -->
2+
<template>
3+
<div class="user-profile-wrapper">
4+
<h1>User Profile</h1>
5+
<UserProfile @logout="onLogout" widget-id="user-profile-widget" />
6+
</div>
7+
</template>
8+
9+
<script setup>
10+
import { UserProfile } from '../../src';
11+
12+
const onLogout = () => (window.location.href = '/login');
13+
</script>
14+
15+
<style>
16+
.manage-users-wrapper {
17+
margin: 20px;
18+
}
19+
</style>

example/router.ts

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import ManageAccessKeys from './components/ManageAccessKeys.vue';
66
import ManageAudit from './components/ManageAudit.vue';
77
import ManageRoles from './components/ManageRoles.vue';
88
import ManageUsers from './components/ManageUsers.vue';
9+
import MyUserProfile from './components/MyUserProfile.vue';
910

1011
const router = createRouter({
1112
history: createWebHistory(),
@@ -56,6 +57,11 @@ const router = createRouter({
5657
path: '/manage-audit',
5758
name: 'manage-audit',
5859
component: ManageAudit
60+
},
61+
{
62+
path: '/user-profile',
63+
name: 'user-profile',
64+
component: MyUserProfile
5965
}
6066
]
6167
});

0 commit comments

Comments
 (0)