@nerdfolio/ba-guest-list 0.0.1 → 0.0.2
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 +13 -7
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
# Better Auth Guest List
|
|
2
|
-
Plugin to provide fixed guest list functionality. Intended use is for development testing and possibly demos with
|
|
3
|
-
know login names, e.g. login as "Alice" or "Bob".
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
Plugin to provide fixed guest list login functionality for [better-auth](https://www.better-auth.com).
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
Intended use is for development testing and possibly demos with known login names, e.g. login as "Alice" or "Bob". You can use it with a single-input form or binding a name to a submit button.
|
|
6
|
+
|
|
7
|
+
The fixed guest list is defined on the server-side with optional roles so this plugin can also be used for testing roles. You can also set it up to
|
|
8
|
+
allow the client access to the guest list (useful for demo login scenarios).
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# How It Works
|
|
12
|
+
|
|
13
|
+
This plugin does not add any field to the schema as its intended use is temporary for testing and demos.
|
|
14
|
+
|
|
15
|
+
Internally, the guest name is transformed into an email via a fixed template, e.g. `tom.onguestlist@emaildomain` and that is the way that user will be looked up. For simplicity, the guest names are restricted to be 1-word names.
|
|
9
16
|
|
|
10
|
-
As this plugin is only intended to be a temporary aid to development and demo, it does not add any field to the schema. Internally, the guest name is transformed into an email via a fixed template, e.g. `tom.onguestlist@emaildomain` and that is the way that user will be looked up.
|
|
11
17
|
|
|
12
18
|
# Installation
|
|
13
19
|
|
|
@@ -46,7 +52,7 @@ export const auth = betterAuth({
|
|
|
46
52
|
|
|
47
53
|
Options:
|
|
48
54
|
|
|
49
|
-
`allowGuests`: can be an array of names or array of `{name: string, role?: string}`.
|
|
55
|
+
`allowGuests`: can be an array of names or array of `{name: string, role?: string}`. Role follows better-auth convention as a comma-separated string of actual roles.
|
|
50
56
|
|
|
51
57
|
`revealNames`: is a boolean. When enabled, the client will be able to retrieve the guest names via `client.signIn.guestList.reveal()`. Names may also be returned in api errors during logins. When undefined or disabled, the `reveal()` endpoint will just return `null` and names will not be sent in error messages.
|
|
52
58
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nerdfolio/ba-guest-list",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Similar to anonymous, but with a name that must be on a guest list. Useful for testing or demo with fixed logins",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
"better-auth",
|
|
20
20
|
"better-auth plugin",
|
|
21
21
|
"guest login",
|
|
22
|
-
"demo login"
|
|
22
|
+
"demo login",
|
|
23
|
+
"anonymous login",
|
|
24
|
+
"auth testing"
|
|
23
25
|
],
|
|
24
26
|
"author": "taivo@github",
|
|
25
27
|
"license": "ISC",
|