Apply suggestions from code review

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
John Richmond 2025-05-13 14:46:33 -07:00 committed by GitHub
parent f84169b630
commit e062feba73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View file

@ -10,7 +10,7 @@ export async function GET(request: NextRequest) {
const state = request.nextUrl.searchParams.get('state') || '';
if (!userId) {
throw new Error('not logged in?');
return new Response('Unauthorized', { status: 401 });
}
const signInToken = await getSignInToken(authObj.userId);

View file

@ -24,7 +24,7 @@ export async function getSignInToken(
userId,
});
return undefined; // probably just throw
throw new Error("Failed to create sign-in token");
}
const data = await response.json();
@ -32,7 +32,6 @@ export async function getSignInToken(
logger.info({
event: 'sign_in_token_created',
userId,
data, // TODO: none of this, probably
});
return data.token;