@webx-ui/module-auth 0.4.1 → 0.5.1

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,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/index.d.ts CHANGED
@@ -1,9 +1,17 @@
1
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';