Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
987e17d
added resources for webdev and appdev
ahaandesai27 Sep 6, 2025
0f93c0d
Added more resources, created more domains, improved responsiveness o…
ahaandesai27 Sep 6, 2025
58257da
refactor(Navbar): improve dropdown handling with timeout and cleanup
PMS61 Sep 21, 2025
01a870c
Modified UI of dashboard and individual domain resource pages, added …
ahaandesai27 Sep 21, 2025
0084aca
feat: add Participant Management component with CRUD functionality
PMS61 Sep 22, 2025
9c6a75f
added more resources for blockchain and cybersec
ahaandesai27 Sep 23, 2025
936b619
Merge remote-tracking branch 'origin/ahaan-resources'
PMS61 Oct 4, 2025
b2e9ffb
Done with Google OAuth Fix and Supabase connectivity
xyz-harshal Oct 5, 2025
24bfffb
some local changes
ahaandesai27 Oct 9, 2025
41292ef
Merge remote-tracking branch 'origin/ahaan-resources'
PMS61 Oct 10, 2025
38c3e00
Integrated event management and registration
PMS61 Oct 10, 2025
e383b72
Migrating from api to actions
PMS61 Oct 11, 2025
910f626
chore: add crypto-browserify and stream-browserify dependencies
PMS61 Oct 11, 2025
bdac014
refactor: standardize registration status property naming across even…
PMS61 Oct 11, 2025
459aad3
feat(cp-club page) : added the cp club page
Kartikay-0111 Oct 11, 2025
46857dd
fix(cp-club page) : minor fix
Kartikay-0111 Oct 11, 2025
04e25bd
feat: enhance team member management by including leader in team_memb…
PMS61 Oct 11, 2025
5686646
Merge branch 'main' into ktk
PMS61 Oct 11, 2025
f451494
Merge pull request #1 from PMS61/ktk
PMS61 Oct 11, 2025
a1d3a5f
fix: restore embla-carousel-react dependency in package.json and pack…
PMS61 Oct 11, 2025
5b526fa
refactor: streamline authentication handler and update Next.js config…
PMS61 Oct 11, 2025
4b94caa
feat: update team member profiles and add images for enhanced represe…
PMS61 Oct 11, 2025
f6fbb66
Fixed dashboard resources view on chrome, added description icon on r…
ahaandesai27 Oct 12, 2025
ff8d9fa
feat: Enhance Events Section with new events and icons, integrate Eve…
PMS61 Oct 12, 2025
455bb92
Remove unused Link import in ExploreSection
PMS61 Oct 12, 2025
0040337
Refactor DevCore component and team member roles
PMS61 Oct 12, 2025
02fe1e2
Refactor TeamsPage component and member data
PMS61 Oct 12, 2025
728ba7d
fixes
PMS61 Oct 12, 2025
c2c6912
feat: Add registration deadline and event status management, enhance …
PMS61 Nov 29, 2025
bda9954
feat: add custom Select component using Radix UI
PMS61 Jan 4, 2026
23c62e3
fix: correct regex pattern for extracting year from email
PMS61 Jan 6, 2026
1f8f723
fix:small bugs found during testing fixed
Kartikay-0111 Jan 8, 2026
1a6bd21
added the coc favicon
Kartikay-0111 Jan 8, 2026
ce66270
Merge pull request #5 from PMS61/ktk
Kartikay-0111 Jan 8, 2026
33615a9
feat: update team members and event management UI with new images and…
PMS61 Jan 9, 2026
b034943
fix: improve event registration status check to ensure registration i…
PMS61 Jan 21, 2026
03aa266
Fix React Server Components CVE vulnerabilities
vercel[bot] Jan 24, 2026
e12207b
Merge pull request #6 from PMS61/vercel/react-server-components-cve-v…
PMS61 Jan 24, 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
15 changes: 15 additions & 0 deletions .codacy/codacy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
runtimes:
- dart@3.7.2
- go@1.22.3
- java@17.0.10
- node@22.2.0
- python@3.11.11
tools:
- dartanalyzer@3.7.2
- eslint@8.57.0
- lizard@1.17.31
- pmd@7.11.0
- pylint@3.3.6
- revive@1.7.0
- semgrep@1.78.0
- trivy@0.66.0
62 changes: 62 additions & 0 deletions app/actions/auth/auth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import {supabaseAdmin} from '@/lib/supabase-admin';
import { cookies } from 'next/headers';
import jwt from 'jsonwebtoken';

export default async function auth(profile:any){
console.log(profile);
//check if user already exists
const { data:existingUser, error:selectError} = await supabaseAdmin
.from('users')
.select('email')
.eq('email',profile.email)
.single();

if(selectError && selectError.code !== 'PGRST116'){
console.error('DB Select error:', selectError);
return { error: 'Database error', status: 500};
}

if(existingUser){
return {status: 'ok',user:existingUser};
}

const dep:string = profile.email.split('@')[1].split('.')[0];
const match = profile.email.match(/_?b(\d+)@/);
let year = match ? parseInt(match[1], 10) + 2000 : null;

// Insert Entry into tabble
const {data:newUser,error:insertError} = await supabaseAdmin
.from('users')
.insert({
email:profile.email,
name:profile.name,
picture:profile.picture,
branch:dep,
year:year,
created_at:new Date().toISOString(),
})
.select('uid,name,email,picture,created_at,branch,year,created_at')
.single();

if (insertError) {
console.error('Insert error:', insertError);
return {
error: 'Failed to create user',
status: 500
};
}
const token = jwt.sign(
{ userId: newUser.uid, email: newUser.email,name: newUser.name },
process.env.JWT_SECRET!,
{ expiresIn: '7d' }
);

const cookieStore = await cookies();
cookieStore.set('token', token, {
httpOnly: false,
secure: process.env.NODE_ENV === 'production',
sameSite: 'strict',
maxAge: 60 * 60 * 24 * 7 // 7 days
});
return {status: 'ok',user:newUser};
}
Loading
Loading