Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/web/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ app.get('/auth/coinpay/callback', async (c) => {
let pass;
try {
({ subject, pass } = await auth.coinPayIdentityFromCode(query.code, pending.codeVerifier));
} catch {
} catch (err) {
console.error(`[coinpay] code exchange failed: ${err?.message ?? err}`);
return c.redirect(pending.userId ? '/app/account?coinpay=failed' : signInError('coinpay-failed'), 302);
}

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export async function coinPayIdentityFromCode(code, codeVerifier) {
});
const tokens = await tokenResponse.json().catch(() => null);
if (!tokenResponse.ok || typeof tokens?.access_token !== 'string' || !tokens.access_token)
throw new Error('CoinPay sign-in failed');
throw new Error(`CoinPay sign-in failed: ${tokenResponse.status} ${tokens?.error ?? ''} ${tokens?.error_description ?? ''}`.trim());

const userResponse = await fetch(config.coinpayOAuth.userInfoUrl, {
headers: { authorization: `Bearer ${tokens.access_token}`, accept: 'application/json' },
Expand Down
Loading