Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
bc6edd6
Merge pull request #41 from HoagieClub/preview
Spencer04Hire Nov 20, 2025
434343e
Merge pull request #47 from HoagieClub/preview
jfmath04 Feb 3, 2026
8fd1abb
update dependencies, fix linting/prettier
ericayrlee Feb 4, 2026
661103e
update stable yarn version
ericayrlee Feb 6, 2026
8bd5168
Try to fix minimatch error
ericayrlee Feb 6, 2026
1b5760f
Update yarn to v4
ericayrlee Feb 6, 2026
5aa7dfb
Update yarn to v4
ericayrlee Feb 6, 2026
bab4f00
added .yarnrc.yml
ericayrlee Feb 6, 2026
57e3996
adding to previous
ericayrlee Feb 6, 2026
2fbfb29
Switch to using auth0 client for getAccessToken
ericayrlee Feb 12, 2026
632d853
Try to fix minimatch error
ericayrlee Feb 12, 2026
c52b9de
Upgrade packages and add new auth0 route setup with proxy.ts
ericayrlee Feb 12, 2026
028b109
Fix eslint rules and update next config
ericayrlee Feb 12, 2026
d21f4dc
Update auth0 env vars
ericayrlee Feb 12, 2026
fbccb80
Update pages and components to use new auth0 hooks
ericayrlee Feb 12, 2026
70181ce
Update yarn to v4
ericayrlee Feb 12, 2026
1f3b8fc
Try to fix minimatch error
ericayrlee Feb 12, 2026
a7b5306
Switch to using auth0 client for getAccessToken
ericayrlee Feb 12, 2026
c9f23e6
Update dependencies, fix linting/prettier
ericayrlee Feb 12, 2026
be2d247
Updating auth0provider
ericayrlee Feb 12, 2026
bf0cad9
reverting some checksum changes
ericayrlee Feb 12, 2026
290cc15
additional auth0 stuff
ericayrlee Feb 12, 2026
fd13ca8
fixing connection error and redoing auth0 updates
ericayrlee Feb 26, 2026
667fb80
changing to auth0
ericayrlee Feb 26, 2026
84385a4
Merge branch 'main' into auth0-update
ericayrlee Feb 26, 2026
2ef4cf2
changing eslint version to 9.0.0 instead of 10.0.0
ericayrlee Feb 26, 2026
5b99845
changing eslint version to 9.0.0 instead of 10.0.0
ericayrlee Feb 26, 2026
3b1d027
reverting previous changes
ericayrlee Mar 26, 2026
a8d8954
Merge remote-tracking branch 'origin/preview' into auth0-update
ericayrlee Mar 26, 2026
da7a43a
removing rainbow logo
ericayrlee Apr 2, 2026
99377ad
removed route.tsx
ericayrlee Apr 2, 2026
044ae02
changes
ericayrlee Apr 2, 2026
ce23953
prettier fixing
ericayrlee Apr 2, 2026
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
4 changes: 2 additions & 2 deletions .env.local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
AUTH0_SECRET=""

# The base URL of your application where users will be redirected after authentication (e.g., http://localhost:3000/).
AUTH0_BASE_URL=""
APP_BASE_URL=""

# The URL of your Auth0 tenant, which identifies the domain associated with your Auth0 account.
AUTH0_ISSUER_BASE_URL=""
AUTH0_DOMAIN=""

# The Client ID of your Auth0 application, used to identify your app to Auth0.
AUTH0_CLIENT_ID=""
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v5

- name: Enable corepack
run: corepack enable

- name: Set up Node.js
uses: actions/setup-node@v5
with:
Expand Down
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
# production
/build

# Editor settings
/.vscode/

# misc
.DS_Store

Expand All @@ -31,3 +34,12 @@ yarn-error.log*
.env.production.local

!.env.local.txt

# Yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.next
next-env.d.ts
1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"quoteProps": "as-needed",
"jsxSingleQuote": true,
"singleQuote": true,

"trailingComma": "es5",
"bracketSpacing": true,
"bracketSameLine": false,
Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
7 changes: 4 additions & 3 deletions app/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import React, { ReactNode } from 'react';

import { useUser } from '@auth0/nextjs-auth0/client';
import { useUser } from '@auth0/nextjs-auth0';
import { Pane, Text, Paragraph } from 'evergreen-ui';

Check failure on line 6 in app/Content.tsx

View workflow job for this annotation

GitHub Actions / ESLint

app/Content.tsx#L6

'Pane' is defined but never used (@typescript-eslint/no-unused-vars)

Check failure on line 6 in app/Content.tsx

View workflow job for this annotation

GitHub Actions / ESLint

app/Content.tsx#L6

'Text' is defined but never used (@typescript-eslint/no-unused-vars)

Check failure on line 6 in app/Content.tsx

View workflow job for this annotation

GitHub Actions / ESLint

app/Content.tsx#L6

'Paragraph' is defined but never used (@typescript-eslint/no-unused-vars)
import { Metadata } from 'next';

import Layout from '@/lib/hoagie-ui/Layout';
Expand All @@ -20,14 +21,14 @@
children,
}: {
children: ReactNode;
}): JSX.Element {
}): React.JSX.Element {
const tabs = [
{ href: '/all', title: 'All' },
{ href: '/marketplace', title: 'Marketplace' },
{ href: '/lost', title: 'Lost & Found' },
{ href: '/bulletins', title: 'Bulletins' },
];
const user = useUser();
const { user } = useUser();

return (
<Theme palette='gray'>
Expand Down
24 changes: 0 additions & 24 deletions app/api/auth/[...auth0]/route.tsx

This file was deleted.

18 changes: 11 additions & 7 deletions app/api/hoagie/[...path]/route.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { getAccessToken, withApiAuthRequired } from '@auth0/nextjs-auth0';
import {
NextRequest,
RequestInit,
} from 'next/dist/server/web/spec-extension/request';
import { NextResponse } from 'next/server';

const handler = withApiAuthRequired(async (request: NextRequest, ctx) => {
import { auth0 } from '@/lib/auth0';

async function handler(
request: NextRequest,
{ params }: { params: Promise<{ path: string[] }> }
) {
// Not very good, fix this later
const path = (ctx?.params?.path as string[]).join('/');
const path = (await params).path.join('/');
const queryString = request.nextUrl.searchParams.toString();

const fetchReq: RequestInit = {
Expand All @@ -22,20 +26,20 @@ const handler = withApiAuthRequired(async (request: NextRequest, ctx) => {
}

try {
const { accessToken } = await getAccessToken();
const accessToken = await auth0.getAccessToken();
fetchReq.headers = {
...fetchReq.headers,
Authorization: `Bearer ${accessToken}`,
Authorization: `Bearer ${accessToken.token}`,
};
} catch (error: any) {
return NextResponse.json({ error: error.message }, { status: 401 });
}

return await proxyRequest(
`${process.env.HOAGIE_API_URL}${path}/?${queryString}`,
`${process.env.HOAGIE_API_URL}${path}?${queryString}`,
fetchReq
);
});
}

async function proxyRequest(url: string, fetchReq: RequestInit) {
try {
Expand Down
2 changes: 1 addition & 1 deletion app/hoagie.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function hoagie() {
export default function hoagie() {
// eslint-disable-next-line no-console
console.log(`
█░█ █▀█ ▄▀█ █▀▀ █ █▀▀
Expand Down
16 changes: 11 additions & 5 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@ import React, { ReactNode } from 'react';

import '@/lib/hoagie-ui/theme.css';
import '@/app/stuff.css';
import { UserProvider } from '@auth0/nextjs-auth0/client';
import { Auth0Provider } from '@auth0/nextjs-auth0';
import { Metadata } from 'next';

import Content from '@/app/Content';
import { hoagie } from '@/app/hoagie';
import hoagie from '@/app/hoagie';
import { auth0 } from '@/lib/auth0';

export const metadata: Metadata = {
title: 'Stuff by Hoagie',
};

export default function App({ children }: { children: ReactNode }) {
export default async function RootLayout({
children,
}: {
children: ReactNode;
}) {
const session = await auth0.getSession();
return (
<html lang='en'>
<head>
Expand All @@ -22,11 +28,11 @@ export default function App({ children }: { children: ReactNode }) {
}}
/>
</head>
<UserProvider>
<Auth0Provider user={session?.user}>
<body>
<Content>{children}</Content>
</body>
</UserProvider>
</Auth0Provider>
</html>
);
}
2 changes: 1 addition & 1 deletion app/marketplace/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import { withPageAuthRequired } from '@auth0/nextjs-auth0/client';

import PostPage from '@/components/PostPage';

export default withPageAuthRequired(() => <PostPage category='sale' />);
export default withPageAuthRequired(() => <PostPage category='marketplace' />);
5 changes: 2 additions & 3 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { useUser } from '@auth0/nextjs-auth0/client';
import { useUser } from '@auth0/nextjs-auth0';
import {
Pane,
majorScale,
Expand All @@ -17,10 +17,9 @@ import Link from 'next/link';
import AuthButton from '@/lib/hoagie-ui/AuthButton';

export default function Index() {
const { user, error, isLoading } = useUser();
const { user, isLoading } = useUser();
let Profile;
if (isLoading) Profile = <Spinner />;
else if (error) Profile = <div>{error.message}</div>;
else if (user) {
Profile = (
<Pane>
Expand Down
8 changes: 6 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* and/or sell copies of the software. This software is provided "as-is", without warranty of any kind.
*/

import nextPlugin from '@next/eslint-plugin-next';
import tsEslintPlugin from '@typescript-eslint/eslint-plugin';
import tsEslintParser from '@typescript-eslint/parser';
import eslintConfigPrettier from 'eslint-config-prettier';
Expand All @@ -21,7 +22,7 @@ import tsEslint from 'typescript-eslint';

export default [
{
ignores: ['.next/*', 'node_modules/*'],
ignores: ['.next/*', 'node_modules/*', 'next-env.d.ts'],
},
{
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
Expand All @@ -44,12 +45,15 @@ export default [
'@typescript-eslint': tsEslintPlugin,
import: importPlugin,
'react-hooks': reactHooksEslint,
'@next/next': nextPlugin,
},
rules: {
...tsEslint.configs.recommended.rules,
...tsEslint.configs.recommendedTypeChecked.rules,
...reactEslint.configs.recommended.rules,
...reactHooksEslint.configs.recommended.rules,
...importPlugin.flatConfigs.recommended.rules,
...nextPlugin.configs.recommended.rules,
...nextPlugin.configs['core-web-vitals'].rules,
'import/order': [
'error',
{
Expand Down
8 changes: 8 additions & 0 deletions lib/auth0.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Auth0Client } from '@auth0/nextjs-auth0/server';

export const auth0 = new Auth0Client({
authorizationParameters: {
scope: process.env.AUTH0_SCOPE,
audience: process.env.AUTH0_AUDIENCE,
},
});
2 changes: 1 addition & 1 deletion lib/hoagie-ui/AuthButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function AuthButton({ variant = 'login', href = '' }: AuthButtonProps) {
</h2>
);
const isLogout = variant === 'logout';
const defHref = isLogout ? '/api/auth/logout' : '/api/auth/login';
const defHref = isLogout ? '/auth/logout' : '/auth/login';

return (
<a href={href === '' ? defHref : href}>
Expand Down
4 changes: 2 additions & 2 deletions lib/hoagie-ui/Nav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import { ComponentType } from 'react';

import { UserProfile } from '@auth0/nextjs-auth0/client';
import { User } from '@auth0/nextjs-auth0/types';
import {
majorScale,
Pane,
Expand Down Expand Up @@ -45,7 +45,7 @@ export type Nav = {
tabs?: Array<any>;

// Authenticated user data.
user?: UserProfile;
user?: User;

// A flag to show the "beta" development disclaimer on the hoagie app logo.
beta?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions lib/hoagie-ui/ProfileCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* and/or sell copies of the software. This software is provided "as-is", without warranty of any kind.
*/

import { UserProfile } from '@auth0/nextjs-auth0/client';
import { User } from '@auth0/nextjs-auth0/types';
import {
majorScale,
Button,
Expand All @@ -25,7 +25,7 @@ import {
* ProfileCard is a profile card meant for display of user information
* throughout different Hoagie applications.
*/
function ProfileCard({ user }: { user: UserProfile }) {
function ProfileCard({ user }: { user: User }) {
const theme = useTheme();
const name = user?.name;
const email =
Expand Down
3 changes: 2 additions & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
22 changes: 22 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { NextConfig } from 'next';
import withPWA from 'next-pwa';

const nextConfig: NextConfig = {
reactStrictMode: true,
...withPWA({
dest: 'public',
register: true,
skipWaiting: true,
}),
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'i.imgur.com',
},
],
},
};

export default nextConfig;
Loading
Loading