@checkstack/backend-api 0.8.2 → 0.9.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/CHANGELOG.md +10 -0
- package/package.json +7 -7
- package/src/auth-strategy.ts +24 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @checkstack/backend-api
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c0c0ed2: Introduce generic "Login Flows" to allow authentication strategies to define their own interaction patterns (form, redirect, or oauth) during registration. This fixes an issue where LDAP login attempts were incorrectly routed through the standard social login flow by instead providing a dedicated credential collection form for LDAP.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- @checkstack/queue-api@0.2.8
|
|
12
|
+
|
|
3
13
|
## 0.8.2
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/backend-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"lint:code": "eslint . --max-warnings 0"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@checkstack/common": "0.6.
|
|
13
|
-
"@checkstack/healthcheck-common": "0.8.
|
|
14
|
-
"@checkstack/queue-api": "0.2.
|
|
15
|
-
"@checkstack/signal-common": "0.1.
|
|
12
|
+
"@checkstack/common": "0.6.4",
|
|
13
|
+
"@checkstack/healthcheck-common": "0.8.4",
|
|
14
|
+
"@checkstack/queue-api": "0.2.7",
|
|
15
|
+
"@checkstack/signal-common": "0.1.8",
|
|
16
16
|
"@orpc/client": "^1.13.14",
|
|
17
17
|
"@orpc/contract": "^1.13.14",
|
|
18
18
|
"@orpc/openapi": "^1.13.2",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/bun": "latest",
|
|
28
|
-
"@checkstack/tsconfig": "0.0.
|
|
29
|
-
"@checkstack/scripts": "0.1.
|
|
28
|
+
"@checkstack/tsconfig": "0.0.4",
|
|
29
|
+
"@checkstack/scripts": "0.1.2"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"hono": "^4.12.14",
|
package/src/auth-strategy.ts
CHANGED
|
@@ -45,8 +45,32 @@ export interface AuthStrategy<Config = unknown> {
|
|
|
45
45
|
* Displayed in the StrategyConfigCard before the configuration form.
|
|
46
46
|
*/
|
|
47
47
|
adminInstructions?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Defines how the frontend should interact with this strategy during login.
|
|
51
|
+
* If not provided, it defaults to 'oauth' for non-credential strategies.
|
|
52
|
+
*/
|
|
53
|
+
clientFlow?: AuthClientFlow;
|
|
48
54
|
}
|
|
49
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Defines the interaction pattern for the frontend during login.
|
|
58
|
+
*/
|
|
59
|
+
export type AuthClientFlow =
|
|
60
|
+
| { type: "oauth" } // Standard Better-Auth social flow
|
|
61
|
+
| { type: "redirect"; target: string } // Redirects user to a custom URL
|
|
62
|
+
| {
|
|
63
|
+
type: "form";
|
|
64
|
+
target: string;
|
|
65
|
+
fields: Array<{
|
|
66
|
+
name: string;
|
|
67
|
+
label: string;
|
|
68
|
+
type: "text" | "password";
|
|
69
|
+
placeholder?: string;
|
|
70
|
+
}>;
|
|
71
|
+
} // Custom credential collection form
|
|
72
|
+
| { type: "credential" }; // Native internal credential flow (internal only)
|
|
73
|
+
|
|
50
74
|
/**
|
|
51
75
|
* Registry for authentication strategies.
|
|
52
76
|
* Allows plugins to register custom auth strategies.
|