sst 3.0.1-22 → 3.0.1-24
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/dist/auth/handler.d.ts +7 -7
- package/dist/auth/handler.js +3 -3
- package/package.json +1 -1
package/dist/auth/handler.d.ts
CHANGED
|
@@ -39,17 +39,17 @@ export declare function AuthHandler<Providers extends Record<string, Adapter<any
|
|
|
39
39
|
session?: Sessions;
|
|
40
40
|
providers: Providers;
|
|
41
41
|
callbacks: {
|
|
42
|
-
index?(
|
|
43
|
-
error?(error: UnknownStateError): Promise<Response | undefined>;
|
|
42
|
+
index?(req: Request): Promise<Response>;
|
|
43
|
+
error?(error: UnknownStateError, req: Request): Promise<Response | undefined>;
|
|
44
44
|
auth: {
|
|
45
|
-
error?(error: MissingParameterError | UnauthorizedClientError | UnknownProviderError): Promise<Response>;
|
|
45
|
+
error?(error: MissingParameterError | UnauthorizedClientError | UnknownProviderError, req: Request): Promise<Response>;
|
|
46
46
|
start?(event: Request): Promise<void>;
|
|
47
|
-
allowClient(clientID: string, redirect: string): Promise<boolean>;
|
|
48
|
-
success(response: OnSuccessResponder<Sessions["$typeValues"]>, input: Result): Promise<Response>;
|
|
47
|
+
allowClient(clientID: string, redirect: string, req: Request): Promise<boolean>;
|
|
48
|
+
success(response: OnSuccessResponder<Sessions["$typeValues"]>, input: Result, req: Request): Promise<Response>;
|
|
49
49
|
};
|
|
50
50
|
connect?: {
|
|
51
|
-
error?(error: InvalidSessionError | UnknownProviderError): Promise<Response | undefined>;
|
|
52
|
-
start?(session: Sessions["$typeValues"],
|
|
51
|
+
error?(error: InvalidSessionError | UnknownProviderError, req: Request): Promise<Response | undefined>;
|
|
52
|
+
start?(session: Sessions["$typeValues"], req: Request): Promise<void>;
|
|
53
53
|
success?(session: Sessions["$typeValues"], input: {}): Promise<Response>;
|
|
54
54
|
};
|
|
55
55
|
};
|
package/dist/auth/handler.js
CHANGED
|
@@ -62,7 +62,7 @@ export function AuthHandler(input) {
|
|
|
62
62
|
const redirect_uri = getCookie(ctx, "redirect_uri");
|
|
63
63
|
const response_type = getCookie(ctx, "response_type");
|
|
64
64
|
if (!redirect_uri) {
|
|
65
|
-
return options.forward(ctx, await input.callbacks.auth.error(new UnknownStateError()));
|
|
65
|
+
return options.forward(ctx, await input.callbacks.auth.error(new UnknownStateError(), ctx.req.raw));
|
|
66
66
|
}
|
|
67
67
|
return await input.callbacks.auth.success({
|
|
68
68
|
async session(session) {
|
|
@@ -101,7 +101,7 @@ export function AuthHandler(input) {
|
|
|
101
101
|
ctx.status(400);
|
|
102
102
|
return ctx.text(`Unsupported response_type: ${response_type}`);
|
|
103
103
|
},
|
|
104
|
-
}, properties);
|
|
104
|
+
}, properties, ctx.req.raw);
|
|
105
105
|
},
|
|
106
106
|
forward(ctx, response) {
|
|
107
107
|
return ctx.newResponse(response.body, response.status, Object.fromEntries(response.headers.entries()));
|
|
@@ -176,7 +176,7 @@ export function AuthHandler(input) {
|
|
|
176
176
|
});
|
|
177
177
|
app.route(`/${name}`, route);
|
|
178
178
|
}
|
|
179
|
-
app.all("/*", async (c
|
|
179
|
+
app.all("/*", async (c) => {
|
|
180
180
|
return c.notFound();
|
|
181
181
|
});
|
|
182
182
|
console.log(app.routes);
|