Skip to content

Commit 4ae6ec7

Browse files
committed
fix: removed basic auth from end user endpoints and removed the protection of the end user handlers
1 parent 597e88e commit 4ae6ec7

15 files changed

+15
-35
lines changed

templates/ords-remix-jwt-sample/app/root.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import {
3030
} from './utils/auth.server';
3131
import NavBar from './components/navbar/NavBar';
3232
import {
33-
BASIC_SCHEMA_AUTH,
3433
CITIES_ENDPOINT,
3534
} from './routes/constants/index.server';
3635
import TooltipButton from './components/tooltips/TooltipButton';
@@ -42,7 +41,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
4241
const userProfile = await auth.isAuthenticated(request);
4342
const profile = userProfile?.profile || null;
4443
const USER_CREDENTIALS = userProfile === null
45-
? BASIC_SCHEMA_AUTH
44+
? ''
4645
: `${userProfile.tokenType} ${userProfile.accessToken}`;
4746
const session = await getSession(request.headers.get('Cookie'));
4847
const error = session.get(auth.sessionErrorKey) as LoaderError;

templates/ords-remix-jwt-sample/app/routes/artists.$id.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
ARTISTS_ENDPOINT,
2323
ARTIST_ENDPOINT,
2424
ARTIST_EVENT_ENDPOINT,
25-
BASIC_SCHEMA_AUTH,
2625
CITIES_ENDPOINT,
2726
LIKED_ARTIST_ENDPOINT,
2827
} from './constants/index.server';
@@ -87,7 +86,7 @@ export const loader = async ({
8786
const userProfile = await auth.isAuthenticated(request);
8887
const profile = userProfile?.profile || null;
8988
const USER_CREDENTIALS = userProfile === null
90-
? BASIC_SCHEMA_AUTH
89+
? ''
9190
: `${userProfile.tokenType} ${userProfile.accessToken}`;
9291
const session = await getSession(request.headers.get('Cookie'));
9392
const error = session.get(auth.sessionErrorKey) as LoaderError;

templates/ords-remix-jwt-sample/app/routes/concerts.$concertID.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import ConcertDetails from '../components/concerts/ConcertDetails';
2929
import {
3030
EVENT_ENDPOINT,
3131
LIKED_EVENT_ENDPOINT,
32-
BASIC_SCHEMA_AUTH,
3332
} from './constants/index.server';
3433
import { UserActions } from '../utils/UserActions';
3534
import ORDSFetcher from '../utils/ORDSFetcher';
@@ -93,7 +92,7 @@ export const loader = async ({
9392
const userProfile = await auth.isAuthenticated(request);
9493
const profile = userProfile?.profile || null;
9594
const USER_CREDENTIALS = userProfile === null
96-
? BASIC_SCHEMA_AUTH
95+
? ''
9796
: `${userProfile.tokenType} ${userProfile.accessToken}`;
9897
const session = await getSession(request.headers.get('Cookie'));
9998
const error = session.get(auth.sessionErrorKey) as LoaderError;

templates/ords-remix-jwt-sample/app/routes/home.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
} from '../utils/auth.server';
2424
import {
2525
STATS_ENDPOINT,
26-
BASIC_SCHEMA_AUTH,
2726
EVENTS_ENDPOINT,
2827
ARTISTS_ENDPOINT,
2928
CONCERTS_BY_CITY_ENDPOINT,
@@ -43,7 +42,7 @@ import featureDescriptions from '../utils/ORDSFeaturesDescription';
4342
export const loader = async ({ request }: LoaderFunctionArgs) => {
4443
const userProfile = await auth.isAuthenticated(request);
4544
const USER_CREDENTIALS = userProfile === null
46-
? BASIC_SCHEMA_AUTH
45+
? ''
4746
: `${userProfile.tokenType} ${userProfile.accessToken}`;
4847
const session = await getSession(request.headers.get('Cookie'));
4948
const error = session.get(auth.sessionErrorKey) as LoaderError;

templates/ords-remix-jwt-sample/app/routes/resources.artists.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
} from '~/utils/auth.server';
1616
import {
1717
ARTISTS_ENDPOINT,
18-
BASIC_SCHEMA_AUTH,
1918
} from './constants/index.server';
2019
import ORDSFetcher from '../utils/ORDSFetcher';
2120

@@ -29,7 +28,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
2928
artistsURL.searchParams.append('limit', limit.toString());
3029
const userProfile = await auth.isAuthenticated(request);
3130
const USER_CREDENTIALS = userProfile === null
32-
? BASIC_SCHEMA_AUTH
31+
? ''
3332
: `${userProfile.tokenType} ${userProfile.accessToken}`;
3433
const session = await getSession(request.headers.get('Cookie'));
3534
const error = session.get(auth.sessionErrorKey) as LoaderError;

templates/ords-remix-jwt-sample/app/routes/resources.cities.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
} from '~/utils/auth.server';
1616
import {
1717
CITIES_ENDPOINT,
18-
BASIC_SCHEMA_AUTH,
1918
} from './constants/index.server';
2019
import ORDSFetcher from '../utils/ORDSFetcher';
2120

@@ -29,7 +28,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
2928
citiesURL.searchParams.append('limit', limit.toString());
3029
const userProfile = await auth.isAuthenticated(request);
3130
const USER_CREDENTIALS = userProfile === null
32-
? BASIC_SCHEMA_AUTH
31+
? ''
3332
: `${userProfile.tokenType} ${userProfile.accessToken}`;
3433
const session = await getSession(request.headers.get('Cookie'));
3534
const error = session.get(auth.sessionErrorKey) as LoaderError;

templates/ords-remix-jwt-sample/app/routes/resources.concerts.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
} from '~/utils/auth.server';
1616
import {
1717
EVENTS_ENDPOINT,
18-
BASIC_SCHEMA_AUTH,
1918
CONCERTS_BY_CITY_ENDPOINT,
2019
} from './constants/index.server';
2120
import ORDSFetcher from '../utils/ORDSFetcher';
@@ -33,7 +32,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
3332
eventsURL.searchParams.append('limit', limit.toString());
3433
const userProfile = await auth.isAuthenticated(request);
3534
const USER_CREDENTIALS = userProfile === null
36-
? BASIC_SCHEMA_AUTH
35+
? ''
3736
: `${userProfile.tokenType} ${userProfile.accessToken}`;
3837
const session = await getSession(request.headers.get('Cookie'));
3938
const error = session.get(auth.sessionErrorKey) as LoaderError;

templates/ords-remix-jwt-sample/app/routes/resources.musicGenres.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
getSession,
1515
} from '~/utils/auth.server';
1616
import {
17-
BASIC_SCHEMA_AUTH,
1817
MUSIC_GENRES_ENDPOINT,
1918
} from './constants/index.server';
2019
import ORDSFetcher from '../utils/ORDSFetcher';
@@ -31,7 +30,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
3130
musicGenresURL.searchParams.append('limit', limit.toString());
3231
const userProfile = await auth.isAuthenticated(request);
3332
const USER_CREDENTIALS = userProfile === null
34-
? BASIC_SCHEMA_AUTH
33+
? ''
3534
: `${userProfile.tokenType} ${userProfile.accessToken}`;
3635
const session = await getSession(request.headers.get('Cookie'));
3736
const error = session.get(auth.sessionErrorKey) as LoaderError;

templates/ords-remix-jwt-sample/app/routes/resources.venues.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
} from '~/utils/auth.server';
1616
import {
1717
VENUES_ENDPOINT,
18-
BASIC_SCHEMA_AUTH,
1918
} from './constants/index.server';
2019
import ORDSFetcher from '../utils/ORDSFetcher';
2120
import ORDSResponse from '../models/ORDSResponse';
@@ -31,7 +30,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
3130
venuesURL.searchParams.append('limit', limit.toString());
3231
const userProfile = await auth.isAuthenticated(request);
3332
const USER_CREDENTIALS = userProfile === null
34-
? BASIC_SCHEMA_AUTH
33+
? ''
3534
: `${userProfile.tokenType} ${userProfile.accessToken}`;
3635
const session = await getSession(request.headers.get('Cookie'));
3736
const error = session.get(auth.sessionErrorKey) as LoaderError;

templates/ords-remix-jwt-sample/app/routes/search.$searchKind.$searchParam.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import type {
1111
import { json } from '@remix-run/node';
1212
import { auth } from '~/utils/auth.server';
1313
import {
14-
BASIC_SCHEMA_AUTH,
1514
ARTISTS_ENDPOINT,
1615
VENUES_ENDPOINT,
1716
EVENTS_BY_NAME_ENDPOINT,
@@ -30,7 +29,7 @@ export const loader = async ({
3029
const { searchKind, searchParam } = params;
3130
const userProfile = await auth.isAuthenticated(request);
3231
const USER_CREDENTIALS = userProfile === null
33-
? BASIC_SCHEMA_AUTH
32+
? ''
3433
: `${userProfile.tokenType} ${userProfile.accessToken}`;
3534
// eslint-disable-next-line no-magic-numbers
3635
const FOLLOWERS = [69420, 99876, 45632, 32496, 98765, 12776, 100000, 88999, 99999];

0 commit comments

Comments
 (0)