an app to share curated trails

Move authorization URL redirect into try/catch

+2 -3
+2 -3
auth/actions.ts
··· 25 25 }); 26 26 27 27 authorizationUrl = url.toString(); 28 + redirect(authorizationUrl); 28 29 } catch (error) { 29 30 console.error("OAuth authorize error:", error); 30 31 const message = error instanceof Error ? error.message : "Unknown error"; 31 32 redirect("/login?error=" + encodeURIComponent(`Login failed: ${message}`)); 32 - } 33 - 34 - redirect(authorizationUrl); 33 + } 35 34 } 36 35 37 36 export async function logout(returnUrl: string = "/") {