Skip to content

Commit

Permalink
refactor: 401 error now properly returned when a user isn't logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
brettski committed Oct 17, 2023
1 parent dff0be8 commit d6d9faa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "thatconference.com",
"version": "5.1.0",
"version": "5.1.1",
"description": "THATConference.com website",
"main": "index.js",
"type": "module",
Expand Down
12 changes: 6 additions & 6 deletions src/routes/api/auth/proxy/+server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import * as Sentry from '@sentry/svelte';
export async function POST({ request, locals }) {
const body = await request.json();

try {
const session = await locals.getSession();
const accessToken = session?.accessToken;
const session = await locals.getSession();
const accessToken = session?.accessToken;

if (!accessToken) {
throw error(401, 'Unauthorized Access');
}
if (!accessToken) {
throw error(401, 'Unauthorized Access');
}

try {
const results = await fetch(config.api.direct, {
method: 'POST',
headers: {
Expand Down

0 comments on commit d6d9faa

Please sign in to comment.