-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: basic token validation for qlty.ai (#1137)
- Loading branch information
1 parent
83ccfd4
commit 028bbf2
Showing
9 changed files
with
77 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { get } from "@vercel/edge-config"; | ||
import { AuthEdgeConfig, AuthEdgeConfigSchema } from "./types"; | ||
|
||
const KEY = "authentication"; | ||
|
||
export async function getAuthEdgeConfig(currentDomain: string): Promise<AuthEdgeConfig | undefined> { | ||
const domainToTokenConfigMap = await get<Record<string, any>>(KEY); | ||
const toRet = domainToTokenConfigMap?.[currentDomain]; | ||
|
||
if (toRet != null) { | ||
// if the config is present, it should be valid | ||
return AuthEdgeConfigSchema.parse(toRet); | ||
} | ||
|
||
return; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export * from "./FernJWT"; | ||
export { getOAuthEdgeConfig } from "./getOAuthEdgeConfig"; | ||
export { getAuthEdgeConfig } from "./getAuthEdgeConfig"; | ||
export { getOAuthToken } from "./getOAuthToken"; | ||
export * from "./types"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters