MCPcopy Create free account
hub / github.com/Waishnav/devspace / redirectHostAllowed

Function redirectHostAllowed

src/oauth-store.ts:28–38  ·  view source on GitHub ↗
(redirectUri: string, allowedHosts: string[])

Source from the content-addressed store, hash-verified

26}
27
28function redirectHostAllowed(redirectUri: string, allowedHosts: string[]): boolean {
29 let parsed: URL;
30 try {
31 parsed = new URL(redirectUri);
32 } catch {
33 return false;
34 }
35
36 if (["localhost", "127.0.0.1", "[::1]"].includes(parsed.hostname)) return true;
37 return allowedHosts.includes(parsed.hostname);
38}
39
40export class SqliteOAuthStore {
41 private readonly database: DatabaseHandle;

Callers 1

registerClientMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected