This repository was archived by the owner on Oct 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +56
-8
lines changed
app/(payload)/api/auth/[...all] Expand file tree Collapse file tree 6 files changed +56
-8
lines changed Original file line number Diff line number Diff line change 1+ import { auth } from "@/lib/auth" ;
2+ import { toNextJsHandler } from "better-auth/next-js" ;
3+
4+ export const { GET , POST } = toNextJsHandler ( auth . handler ) ;
Original file line number Diff line number Diff line change 11// THEME CREDITS: github.com/akhrarovsaid/payload-theme-quantum-leap
22// github.com/jhb-software/payload-plugins/tree/main/geocoding
33import path from "node:path" ;
4- // import { s3Storage } from '@payloadcms/storage-s3'
54/* eslint-disable node/prefer-global/process */
5+ // import { s3Storage } from '@payloadcms/storage-s3'
66import { fileURLToPath } from "node:url" ;
77import {
8- // googleOAuth,
9- linkedinOAuth } from '@/cms/endpoints/auth'
8+ googleOAuth ,
9+ linkedinOAuth
10+ } from '@/cms/endpoints/auth'
1011import { Brands } from "@/db/collections"
1112import { Media , Users , Emails } from "@/db/collections/models" ;
1213import { Website , SocialLinks } from "@/db/collections/globals" ;
@@ -102,6 +103,8 @@ export default buildConfig({
102103 generateSchemaOutputFile : path . resolve ( "../../libs/db/schema.ts" ) ,
103104 } ) ,
104105 plugins : [
106+ googleOAuth ,
107+ linkedinOAuth
105108 // process.env.NODE_ENV == 'production' && s3Storage({
106109 // collections: {
107110 // media: {
@@ -120,8 +123,5 @@ export default buildConfig({
120123 // endpoint: process.env.S3_ENDPOINT,
121124 // },
122125 // }),
123- // googleOAuth,
124- linkedinOAuth
125- // payloadCloudPlugin(),
126126 ] ,
127127} ) ;
Original file line number Diff line number Diff line change 1+ import {
2+ betterAuth
3+ } from 'better-auth' ;
4+
5+ export const auth = betterAuth ( {
6+ socialProviders : {
7+ linkedin : {
8+ clientId : process . env . LINKEDIN_CLIENT_ID ,
9+ clientSecret : process . env . LINKEDIN_CLIENT_SECRET
10+ }
11+ } ,
12+
13+ /** if no database is provided, the user data will be stored in memory.
14+ * Make sure to provide a database to persist user data **/
15+ } ) ;
Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ export interface User {
213213 * This could be a company, university, or student club.
214214 */
215215 brandRelation ?: ( number | null ) | Brand ;
216- linkedIn ?: string | null ;
216+ linkedin ?: string | null ;
217217 discord ?: string | null ;
218218 github ?: string | null ;
219219 behance ?: string | null ;
@@ -264,6 +264,11 @@ export interface User {
264264 emergencyContactFullName ?: string | null ;
265265 emergencyContactCell ?: string | null ;
266266 emergencyContactEmailAddress ?: string | null ;
267+ linkedinSub ?: string | null ;
268+ linkedinEmailVerified ?: string | null ;
269+ linkedinLocale ?: string | null ;
270+ googleSub ?: string | null ;
271+ googleEmailVerified ?: string | null ;
267272 sub ?: string | null ;
268273 updatedAt : string ;
269274 createdAt : string ;
@@ -432,7 +437,7 @@ export interface UsersSelect<T extends boolean = true> {
432437 pronouns ?: T ;
433438 avatar ?: T ;
434439 brandRelation ?: T ;
435- linkedIn ?: T ;
440+ linkedin ?: T ;
436441 discord ?: T ;
437442 github ?: T ;
438443 behance ?: T ;
@@ -443,6 +448,11 @@ export interface UsersSelect<T extends boolean = true> {
443448 emergencyContactFullName ?: T ;
444449 emergencyContactCell ?: T ;
445450 emergencyContactEmailAddress ?: T ;
451+ linkedinSub ?: T ;
452+ linkedinEmailVerified ?: T ;
453+ linkedinLocale ?: T ;
454+ googleSub ?: T ;
455+ googleEmailVerified ?: T ;
446456 sub ?: T ;
447457 updatedAt ?: T ;
448458 createdAt ?: T ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { Button } from '@cuhacking/shared/ui/button'
33import { GlassmorphicCard } from '@cuhacking/shared/ui/glassmorphic-card'
44import { Typography } from '@cuhacking/shared/ui/typography'
55import { Form , useNavigation } from '@remix-run/react'
6+ import { signIn } from '../../../pages/login/index'
67
78export function LoginCallToAction ( ) {
89 const transition = useNavigation ( )
@@ -28,6 +29,12 @@ export function LoginCallToAction() {
2829 className = "flex items-center gap-x-3 px-4 md:px-6 lg:px-8 py-4"
2930 aria-label = "Login with Linkedin"
3031 disabled = { transition . state === 'submitting' }
32+ onClick = { async ( ) => {
33+ await signIn . social ( {
34+ provider : 'linkedin' ,
35+ callbackURL : '/hello' ,
36+ } )
37+ } }
3138 >
3239 < img src = { linkedinBlack } alt = "Linkedin logo" className = "size-5" />
3340 < Typography variant = "h6" > Log In</ Typography >
Original file line number Diff line number Diff line change 11import dashboard_background from '@cuhacking/portal/assets/backgrounds/dashboard-bg-1.webp'
22import { LoginCallToAction } from '@cuhacking/portal/features/login'
3+ import { createAuthClient } from 'better-auth/react'
4+
5+ export const authClient = createAuthClient ( {
6+ baseURL : process . env . development ? process . env . CUHACKING_2025_AXIOM_LOCAL_URL : process . env . CUHACKING_2025_AXIOM_PUBLIC_URL ,
7+ } )
8+
9+ export const {
10+ signIn,
11+ signOut,
12+ signUp,
13+ useSession,
14+ } = authClient
315
416export function Login ( ) {
517 return (
You can’t perform that action at this time.
0 commit comments