Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 1 addition & 2 deletions templates/ords-remix-jwt-sample/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
} from './utils/auth.server';
import NavBar from './components/navbar/NavBar';
import {
BASIC_SCHEMA_AUTH,
CITIES_ENDPOINT,
} from './routes/constants/index.server';
import TooltipButton from './components/tooltips/TooltipButton';
Expand All @@ -42,7 +41,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
const userProfile = await auth.isAuthenticated(request);
const profile = userProfile?.profile || null;
const USER_CREDENTIALS = userProfile === null
? BASIC_SCHEMA_AUTH
? ''
: `${userProfile.tokenType} ${userProfile.accessToken}`;
const session = await getSession(request.headers.get('Cookie'));
const error = session.get(auth.sessionErrorKey) as LoaderError;
Expand Down
3 changes: 1 addition & 2 deletions templates/ords-remix-jwt-sample/app/routes/artists.$id.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
ARTISTS_ENDPOINT,
ARTIST_ENDPOINT,
ARTIST_EVENT_ENDPOINT,
BASIC_SCHEMA_AUTH,
CITIES_ENDPOINT,
LIKED_ARTIST_ENDPOINT,
} from './constants/index.server';
Expand Down Expand Up @@ -87,7 +86,7 @@ export const loader = async ({
const userProfile = await auth.isAuthenticated(request);
const profile = userProfile?.profile || null;
const USER_CREDENTIALS = userProfile === null
? BASIC_SCHEMA_AUTH
? ''
: `${userProfile.tokenType} ${userProfile.accessToken}`;
const session = await getSession(request.headers.get('Cookie'));
const error = session.get(auth.sessionErrorKey) as LoaderError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import ConcertDetails from '../components/concerts/ConcertDetails';
import {
EVENT_ENDPOINT,
LIKED_EVENT_ENDPOINT,
BASIC_SCHEMA_AUTH,
} from './constants/index.server';
import { UserActions } from '../utils/UserActions';
import ORDSFetcher from '../utils/ORDSFetcher';
Expand Down Expand Up @@ -93,7 +92,7 @@ export const loader = async ({
const userProfile = await auth.isAuthenticated(request);
const profile = userProfile?.profile || null;
const USER_CREDENTIALS = userProfile === null
? BASIC_SCHEMA_AUTH
? ''
: `${userProfile.tokenType} ${userProfile.accessToken}`;
const session = await getSession(request.headers.get('Cookie'));
const error = session.get(auth.sessionErrorKey) as LoaderError;
Expand Down
3 changes: 1 addition & 2 deletions templates/ords-remix-jwt-sample/app/routes/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
} from '../utils/auth.server';
import {
STATS_ENDPOINT,
BASIC_SCHEMA_AUTH,
EVENTS_ENDPOINT,
ARTISTS_ENDPOINT,
CONCERTS_BY_CITY_ENDPOINT,
Expand All @@ -43,7 +42,7 @@ import featureDescriptions from '../utils/ORDSFeaturesDescription';
export const loader = async ({ request }: LoaderFunctionArgs) => {
const userProfile = await auth.isAuthenticated(request);
const USER_CREDENTIALS = userProfile === null
? BASIC_SCHEMA_AUTH
? ''
: `${userProfile.tokenType} ${userProfile.accessToken}`;
const session = await getSession(request.headers.get('Cookie'));
const error = session.get(auth.sessionErrorKey) as LoaderError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
} from '~/utils/auth.server';
import {
ARTISTS_ENDPOINT,
BASIC_SCHEMA_AUTH,
} from './constants/index.server';
import ORDSFetcher from '../utils/ORDSFetcher';

Expand All @@ -29,7 +28,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
artistsURL.searchParams.append('limit', limit.toString());
const userProfile = await auth.isAuthenticated(request);
const USER_CREDENTIALS = userProfile === null
? BASIC_SCHEMA_AUTH
? ''
: `${userProfile.tokenType} ${userProfile.accessToken}`;
const session = await getSession(request.headers.get('Cookie'));
const error = session.get(auth.sessionErrorKey) as LoaderError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
} from '~/utils/auth.server';
import {
CITIES_ENDPOINT,
BASIC_SCHEMA_AUTH,
} from './constants/index.server';
import ORDSFetcher from '../utils/ORDSFetcher';

Expand All @@ -29,7 +28,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
citiesURL.searchParams.append('limit', limit.toString());
const userProfile = await auth.isAuthenticated(request);
const USER_CREDENTIALS = userProfile === null
? BASIC_SCHEMA_AUTH
? ''
: `${userProfile.tokenType} ${userProfile.accessToken}`;
const session = await getSession(request.headers.get('Cookie'));
const error = session.get(auth.sessionErrorKey) as LoaderError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
} from '~/utils/auth.server';
import {
EVENTS_ENDPOINT,
BASIC_SCHEMA_AUTH,
CONCERTS_BY_CITY_ENDPOINT,
} from './constants/index.server';
import ORDSFetcher from '../utils/ORDSFetcher';
Expand All @@ -33,7 +32,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
eventsURL.searchParams.append('limit', limit.toString());
const userProfile = await auth.isAuthenticated(request);
const USER_CREDENTIALS = userProfile === null
? BASIC_SCHEMA_AUTH
? ''
: `${userProfile.tokenType} ${userProfile.accessToken}`;
const session = await getSession(request.headers.get('Cookie'));
const error = session.get(auth.sessionErrorKey) as LoaderError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
getSession,
} from '~/utils/auth.server';
import {
BASIC_SCHEMA_AUTH,
MUSIC_GENRES_ENDPOINT,
} from './constants/index.server';
import ORDSFetcher from '../utils/ORDSFetcher';
Expand All @@ -31,7 +30,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
musicGenresURL.searchParams.append('limit', limit.toString());
const userProfile = await auth.isAuthenticated(request);
const USER_CREDENTIALS = userProfile === null
? BASIC_SCHEMA_AUTH
? ''
: `${userProfile.tokenType} ${userProfile.accessToken}`;
const session = await getSession(request.headers.get('Cookie'));
const error = session.get(auth.sessionErrorKey) as LoaderError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
} from '~/utils/auth.server';
import {
VENUES_ENDPOINT,
BASIC_SCHEMA_AUTH,
} from './constants/index.server';
import ORDSFetcher from '../utils/ORDSFetcher';
import ORDSResponse from '../models/ORDSResponse';
Expand All @@ -31,7 +30,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
venuesURL.searchParams.append('limit', limit.toString());
const userProfile = await auth.isAuthenticated(request);
const USER_CREDENTIALS = userProfile === null
? BASIC_SCHEMA_AUTH
? ''
: `${userProfile.tokenType} ${userProfile.accessToken}`;
const session = await getSession(request.headers.get('Cookie'));
const error = session.get(auth.sessionErrorKey) as LoaderError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import type {
import { json } from '@remix-run/node';
import { auth } from '~/utils/auth.server';
import {
BASIC_SCHEMA_AUTH,
ARTISTS_ENDPOINT,
VENUES_ENDPOINT,
EVENTS_BY_NAME_ENDPOINT,
Expand All @@ -30,7 +29,7 @@ export const loader = async ({
const { searchKind, searchParam } = params;
const userProfile = await auth.isAuthenticated(request);
const USER_CREDENTIALS = userProfile === null
? BASIC_SCHEMA_AUTH
? ''
: `${userProfile.tokenType} ${userProfile.accessToken}`;
// eslint-disable-next-line no-magic-numbers
const FOLLOWERS = [69420, 99876, 45632, 32496, 98765, 12776, 100000, 88999, 99999];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
auth, getSession,
} from '../utils/auth.server';
import {
BASIC_SCHEMA_AUTH,
MUSIC_GENRES_ENDPOINT,
AUTO_REST_SEARCH_ARTISTS_ENDPOINT,
} from './constants/index.server';
Expand All @@ -34,7 +33,7 @@ import DiscoverArtists from '../components/search/DiscoverArtists';
export const loader = async ({ request }: LoaderFunctionArgs) => {
const userProfile = await auth.isAuthenticated(request);
const USER_CREDENTIALS = userProfile === null
? BASIC_SCHEMA_AUTH
? ''
: `${userProfile.tokenType} ${userProfile.accessToken}`;
const session = await getSession(request.headers.get('Cookie'));
const error = session.get(auth.sessionErrorKey) as LoaderError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
auth, getSession,
} from '../utils/auth.server';
import {
BASIC_SCHEMA_AUTH,
AUTO_REST_SEARCH_ENDPOINT,
CITIES_ENDPOINT,
ARTISTS_ENDPOINT,
Expand All @@ -38,7 +37,7 @@ import Artist from '../models/Artist';
export const loader = async ({ request }: LoaderFunctionArgs) => {
const userProfile = await auth.isAuthenticated(request);
const USER_CREDENTIALS = userProfile === null
? BASIC_SCHEMA_AUTH
? ''
: `${userProfile.tokenType} ${userProfile.accessToken}`;
const session = await getSession(request.headers.get('Cookie'));
const error = session.get(auth.sessionErrorKey) as LoaderError;
Expand Down
3 changes: 1 addition & 2 deletions templates/ords-remix-jwt-sample/app/routes/search.venues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
auth, getSession,
} from '../utils/auth.server';
import {
BASIC_SCHEMA_AUTH,
AUTO_REST_SEARCH_VENUES_ENDPOINT,
CITIES_ENDPOINT,
} from './constants/index.server';
Expand All @@ -34,7 +33,7 @@ import ORDSResponse from '../models/ORDSResponse';
export const loader = async ({ request }: LoaderFunctionArgs) => {
const userProfile = await auth.isAuthenticated(request);
const USER_CREDENTIALS = userProfile === null
? BASIC_SCHEMA_AUTH
? ''
: `${userProfile.tokenType} ${userProfile.accessToken}`;
const session = await getSession(request.headers.get('Cookie'));
const error = session.get(auth.sessionErrorKey) as LoaderError;
Expand Down
4 changes: 2 additions & 2 deletions templates/ords-remix-jwt-sample/app/routes/venues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
auth,
getSession,
} from '~/utils/auth.server';
import { BASIC_SCHEMA_AUTH, VENUES_ENDPOINT } from './constants/index.server';
import { VENUES_ENDPOINT } from './constants/index.server';
import { LoaderError } from '../models/LoaderError';
import ORDSFetcher from '../utils/ORDSFetcher';
import Venue from '../models/Venue';
Expand All @@ -22,7 +22,7 @@ export const loader = async ({
}: LoaderFunctionArgs) => {
const userProfile = await auth.isAuthenticated(request);
const USER_CREDENTIALS = userProfile === null
? BASIC_SCHEMA_AUTH
? ''
: `${userProfile.tokenType} ${userProfile.accessToken}`;
const session = await getSession(request.headers.get('Cookie'));
const error = session.get(auth.sessionErrorKey) as LoaderError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ async function protectEndpoints(
'concert_app.adminuser.v1',
)}

${definePrivilege(
'concert_app_euser',
'Non authenticated end user privilege',
'Provides limited access to the concert app endpoints',
'concert_app.euser.v1',
)}

COMMIT;
END;
/
Expand Down