@webx-ui/module-auth 0.4.0 → 0.5.0
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 +3 -3
- package/dist/UserMenu.d.ts +4 -0
- package/dist/admins.d.ts +1 -1
- package/dist/index.d.ts +11 -3
- package/dist/index.js +416 -398
- package/dist/index.js.map +1 -1
- package/dist/messages.d.ts +1 -1
- package/dist/module.d.ts +1 -1
- package/dist/session.d.ts +10 -2
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -9,11 +9,11 @@ closes the panel on the server. This is what lets somebody back in.
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
pnpm add @webx-ui/module-auth @webx-ui/admin @webx-ui/core vue vue-router
|
|
12
|
+
pnpm add @webx-ui/module-auth @webx-ui/module-admin @webx-ui/core vue vue-router
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
|
-
import { createAdmin } from '@webx-ui/admin'
|
|
16
|
+
import { createAdmin } from '@webx-ui/module-admin'
|
|
17
17
|
import { auth, WxUserMenu } from '@webx-ui/module-auth'
|
|
18
18
|
|
|
19
19
|
createAdmin({
|
|
@@ -23,7 +23,7 @@ createAdmin({
|
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
That is the whole integration. Installing it also tells the panel how to find out who is signed
|
|
26
|
-
in, which is why `@webx-ui/admin` knows nothing about authentication — it holds the answer, not
|
|
26
|
+
in, which is why `@webx-ui/module-admin` knows nothing about authentication — it holds the answer, not
|
|
27
27
|
the question.
|
|
28
28
|
|
|
29
29
|
## A plugin, not a section
|
package/dist/UserMenu.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AvatarResolver } from './session';
|
|
1
2
|
/**
|
|
2
3
|
* The corner of the header: who this is, which language they read the panel in, and the way
|
|
3
4
|
* out.
|
|
@@ -8,8 +9,11 @@
|
|
|
8
9
|
*/
|
|
9
10
|
type __VLS_Props = {
|
|
10
11
|
signOutLabel?: string;
|
|
12
|
+
/** Overrides the resolver `auth()` was given. Without either, initials. */
|
|
13
|
+
resolveAvatar?: AvatarResolver;
|
|
11
14
|
};
|
|
12
15
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
16
|
+
resolveAvatar: AvatarResolver;
|
|
13
17
|
signOutLabel: string;
|
|
14
18
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
19
|
export default _default;
|
package/dist/admins.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { AdminPlugin } from '@webx-ui/admin';
|
|
1
|
+
import { AdminPlugin } from '@webx-ui/module-admin';
|
|
2
|
+
import { AvatarResolver } from './session';
|
|
2
3
|
export interface AuthOptions {
|
|
3
4
|
/** Where the sign-in screen lives, inside the panel. */
|
|
4
5
|
path?: string;
|
|
5
6
|
/** Props handed to the card — the labels, mostly. */
|
|
6
7
|
card?: Record<string, unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* Turns the key the signed-in person's photograph is stored under into an address, so the
|
|
10
|
+
* menu in the corner shows the picture rather than initials. The same function `admins()`
|
|
11
|
+
* takes: this package does not depend on the media one, and the panel is the only place
|
|
12
|
+
* that knows both are installed.
|
|
13
|
+
*/
|
|
14
|
+
resolveAvatar?: AvatarResolver;
|
|
7
15
|
}
|
|
8
16
|
/**
|
|
9
17
|
* Signing in, as a plugin rather than a section: it owns a route and a guard, and it has no
|
|
@@ -19,8 +27,8 @@ export { selectAdmin, selectAdmins, type AdminPickerOptions } from './selectAdmi
|
|
|
19
27
|
export { default as WxAdminsPage } from './AdminsPage';
|
|
20
28
|
export { default as WxAdminList } from './AdminList';
|
|
21
29
|
export type { Admin, AdminInput, AdminPage, AdminQuery, AdminRole, Role } from './types';
|
|
22
|
-
export { createAuthSession, provideAuth, useAuth, authKey } from './session';
|
|
23
|
-
export type { AuthSession, Credentials } from './session';
|
|
30
|
+
export { createAuthSession, provideAuth, useAuth, authKey, avatarResolverKey } from './session';
|
|
31
|
+
export type { AuthSession, AvatarResolver, Credentials } from './session';
|
|
24
32
|
export { default as WxLoginCard } from './LoginCard';
|
|
25
33
|
export { default as WxUserMenu } from './UserMenu';
|
|
26
34
|
export { authMessages } from './messages';
|