feat: Add support for mapped providers to kv_oauth plugin (#1792)
This commit is contained in:
@@ -36,4 +36,18 @@ Deno.test("kvOAuthPlugin() works correctly", async (test) => {
|
||||
signOutPath,
|
||||
]);
|
||||
});
|
||||
|
||||
await test.step("with mapped providers", () => {
|
||||
const providerKey = "customProvider";
|
||||
const plugin = kvOAuthPlugin({
|
||||
[providerKey]: oauth2Client,
|
||||
});
|
||||
assertNotEquals(plugin.routes, undefined);
|
||||
assert(plugin.routes!.every((route) => route.handler !== undefined));
|
||||
assertArrayIncludes(plugin.routes!.map((route) => route.path), [
|
||||
`/oauth/${providerKey}/signin`,
|
||||
`/oauth/${providerKey}/callback`,
|
||||
`/oauth/${providerKey}/signout`,
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user