Skip to content

Commit 860a50a

Browse files
committed
feat(api/portal): implement logout
1 parent 12c582d commit 860a50a

File tree

6 files changed

+30
-21
lines changed

6 files changed

+30
-21
lines changed

apps/portal/app/routes/logout.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* eslint-disable node/prefer-global/process */
2+
import type { LoaderFunction } from '@remix-run/node'
3+
import { redirect } from '@remix-run/node'
4+
5+
export const loader: LoaderFunction = async () => {
6+
const adminURL
7+
= process.env.NODE_ENV === 'development'
8+
? `${process.env.CUHACKING_2025_AXIOM_LOCAL_URL}/admin/logout`
9+
: `${process.env.CUHACKING_2025_AXIOM_PUBLIC_URL}/admin/logout`
10+
11+
return redirect(adminURL)
12+
}

libs/db/globals/Hackathon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export const Hackathon2025: GlobalConfig = {
122122
{ title: "Sponsors - Coming Soon!!" },
123123
{ title: "Schedule - Coming Soon!!" },
124124
{ title: "Challenges - Coming Soon!!" },
125-
{ title: "More Features!! Maybe you will add it!" },
125+
{ title: "More Features!! Maybe you'll add them!" },
126126
{ title: "Star our GitHub" },
127127
],
128128
},

libs/portal/features/profile/constants.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable node/prefer-global/process */
21
import { tShirtSizes } from '@cuhacking/portal/types/tShirt'
32
import { YearStandings } from '@cuhacking/portal/types/year-standings'
43

@@ -558,9 +557,7 @@ export const YEAR_STANDINGS = Object.keys(YearStandings).map(key => ({
558557
}))
559558

560559
export const AUTH_LINK = {
561-
DISCORD: process.env.NODE_ENV === 'development'
562-
? `${process.env.CUHACKING_2025_AXIOM_LOCAL_URL}/api/users/oauth/discord`
563-
: `${process.env.CUHACKING_2025_AXIOM_PUBLIC_URL}/api/users/oauth/discord`,
560+
DISCORD: 'https://discord.com',
564561
BEHANCE: 'https://behance.com',
565562
INSTAGRAM: 'https://instagram.com',
566563
}

libs/portal/features/registration/ui/registration.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
import type * as z from 'zod'
22
import { useRegistrationSchema } from '@cuhacking/portal/features/registration/hooks/use-registration-schema'
3-
import { AuthenticationField } from '@cuhacking/portal/shared/features/form/ui/authentication-field'
3+
/* import { AuthenticationField } from '@cuhacking/portal/shared/features/form/ui/authentication-field' */
44
import { ComboboxField } from '@cuhacking/portal/shared/features/form/ui/combobox-field'
55
import { MultiSelectField } from '@cuhacking/portal/shared/features/form/ui/multi-select-field'
66
import { TextAreaField } from '@cuhacking/portal/shared/features/form/ui/text-area-field' // Ensure this is correct
7-
import { Provider } from '@cuhacking/shared/types/auth'
7+
/* import { Provider } from '@cuhacking/shared/types/auth' */
88
import { Button } from '@cuhacking/shared/ui/button'
99
import { Typography } from '@cuhacking/shared/ui/typography'
1010
import { useNavigate } from '@remix-run/react'
1111
import { useState } from 'react'
1212
import { FormProvider } from 'react-hook-form'
1313
import { CHALLENGE_INTERESTS, DISCOVERY_SOURCES, QNX_EXPERIENCE, WORKSHOP_INTERESTS } from '../constants'
1414

15-
const AUTH_LINK = {
16-
GITHUB: 'https://github.com',
17-
}
15+
/* const AUTH_LINK = {
16+
* GITHUB: 'https://github.com',
17+
* } */
1818

1919
interface RegistrationPropse {
2020
onSubmit: (values: z.infer<any>) => Promise<Response>
2121
}
2222
export function Registration({ onSubmit }: RegistrationPropse) {
2323
const [isLoading, setIsLoading] = useState<boolean>(false)
24-
const initialSocialMediaHandles = {
25-
gitHub: '',
26-
}
24+
/* const initialSocialMediaHandles = {
25+
* gitHub: '',
26+
* } */
2727

2828
const navigate = useNavigate()
2929

30-
const [socialMediaHandles, _setSocialMediaHandles] = useState<
31-
typeof initialSocialMediaHandles
32-
>(initialSocialMediaHandles)
30+
/* const [socialMediaHandles, _setSocialMediaHandles] = useState<
31+
* typeof initialSocialMediaHandles
32+
* >(initialSocialMediaHandles) */
3333

3434
const { registration, isValid, isDirty } = useRegistrationSchema()
3535

@@ -54,12 +54,12 @@ export function Registration({ onSubmit }: RegistrationPropse) {
5454
<FormProvider {...registration}>
5555
<form method="post" className="flex flex-col gap-y-4 w-full px-4 pb-6" onSubmit={registration.handleSubmit(handleSubmit)}>
5656

57-
<AuthenticationField
57+
{/* <AuthenticationField
5858
provider={Provider.gitHub}
5959
link={AUTH_LINK.GITHUB}
6060
userTag={socialMediaHandles.gitHub}
6161
isRequired
62-
/>
62+
/> */}
6363

6464
<MultiSelectField
6565
className="z-4"

libs/portal/pages/index/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ const constants = {
3737
icon: calendar,
3838
},
3939
{
40-
label: 'CHALLANGES - Coming soon!!',
40+
label: 'CHALLENGES - Coming soon!!',
4141
icon: mountain,
4242
},
4343
{
44-
label: 'MORE FEATURES!! Maybe You will aDD it!!',
44+
label: 'MORE FEATURES!! Maybe You\'ll add them!!',
4545
icon: null,
4646
},
4747
],

libs/portal/pages/registration/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function RegistrationPage({ user }: { user: UserDetails }) {
2424
response = await postForm(refinedValues, cookie, API_URL, user.id)
2525

2626
if (response.error) {
27-
return new Response('Couldn\'t register user for hackahton', { status: 400 })
27+
return new Response('Couldn\'t register user for hackathon', { status: 400 })
2828
}
2929

3030
toast.success(toastMessage, {

0 commit comments

Comments
 (0)