mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-07-08 22:05:16 +02:00
Better error
This commit is contained in:
@@ -56,7 +56,7 @@ export async function getAuthorizationCode(
|
|||||||
try {
|
try {
|
||||||
authorizationUrl = new URL(`${authorizationUrlRaw ?? ''}`);
|
authorizationUrl = new URL(`${authorizationUrlRaw ?? ''}`);
|
||||||
} catch {
|
} catch {
|
||||||
throw new Error('Invalid authorization URL: ' + authorizationUrlRaw);
|
throw new Error(`Invalid authorization URL "${authorizationUrlRaw}"`);
|
||||||
}
|
}
|
||||||
authorizationUrl.searchParams.set('response_type', 'code');
|
authorizationUrl.searchParams.set('response_type', 'code');
|
||||||
authorizationUrl.searchParams.set('client_id', clientId);
|
authorizationUrl.searchParams.set('client_id', clientId);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export async function getImplicit(
|
|||||||
try {
|
try {
|
||||||
authorizationUrl = new URL(`${authorizationUrlRaw ?? ''}`);
|
authorizationUrl = new URL(`${authorizationUrlRaw ?? ''}`);
|
||||||
} catch {
|
} catch {
|
||||||
throw new Error('Invalid authorization URL: ' + authorizationUrlRaw);
|
throw new Error(`Invalid authorization URL "${authorizationUrlRaw}"`);
|
||||||
}
|
}
|
||||||
authorizationUrl.searchParams.set('response_type', 'token');
|
authorizationUrl.searchParams.set('response_type', 'token');
|
||||||
authorizationUrl.searchParams.set('client_id', clientId);
|
authorizationUrl.searchParams.set('client_id', clientId);
|
||||||
|
|||||||
Reference in New Issue
Block a user