Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion app/(dashboard)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export default function DashboardLayout({
<span className="text-[#c8102e] font-bold text-xl tracking-tight">Chambers</span>
</div>
<p className="text-slate-500 text-xs mt-0.5">NU Student Gov. Association</p>
<p className="text-slate-600 text-xs mt-1">v1.12.0</p>
<p className="text-slate-600 text-xs mt-1">v1.12.1</p>
{userName && (
<div className="flex items-start justify-between mt-2">
<p className="text-slate-500 text-xs italic">{getGreeting()},<br />{userName}</p>
Expand Down
4 changes: 2 additions & 2 deletions app/(dashboard)/sga-spaces/space-calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ export default function SpaceCalendar({
const totalHeight = TOTAL_SLOTS * SLOT_HEIGHT

return (
<div className="rounded-xl border border-[#1e5080] overflow-hidden bg-[#0a1628] select-none">
<div className="rounded-xl border border-[#1e5080] overflow-hidden bg-[#0a1628] select-none isolate">
<div ref={scrollRef} className="overflow-y-auto" style={{ maxHeight: '648px' }}>
{/* Sticky day header */}
<div ref={headerRef} className="flex border-b border-[#1e5080] sticky top-0 z-10 bg-[#0a1628]">
<div ref={headerRef} className="flex border-b border-[#1e5080] sticky top-0 z-[60] bg-[#0a1628]">
<div className="w-14 flex-shrink-0 border-r border-[#1e5080]" />
{dayLabels.map((dl, i) => (
<div
Expand Down
14 changes: 14 additions & 0 deletions app/api/administrator/users/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ export async function POST(request: Request) {

const { email, full_name, admin_role, iems_role } = await request.json()

// Block re-inviting a deactivated account — admin must reactivate instead
const { count: deactivatedCount } = await adminSupabase
.from('users')
.select('id', { count: 'exact', head: true })
.eq('email', email.trim().toLowerCase())
.eq('is_active', false)

if (deactivatedCount && deactivatedCount > 0) {
return NextResponse.json(
{ error: 'A deactivated account already exists for this email. Reactivate the account instead of sending a new invite.' },
{ status: 400 }
)
}

const otp = randomBytes(8).toString('base64url').slice(0, 12)
const otpHash = createHash('sha256').update(otp).digest('hex')
const otpExpiresAt = new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString()
Expand Down
6 changes: 6 additions & 0 deletions app/api/onboarding/profile/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,11 @@ export async function PATCH(request: Request) {

if (error) return NextResponse.json({ error: error.message }, { status: 500 })

const { error: metaError } = await adminSupabase.auth.admin.updateUserById(user.id, {
user_metadata: { full_name },
})

if (metaError) return NextResponse.json({ error: metaError.message }, { status: 500 })

return NextResponse.json({ success: true })
}
14 changes: 14 additions & 0 deletions app/api/signup/request/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ export async function POST(request: Request) {

const normalizedEmail = email.trim().toLowerCase()

// Block deactivated accounts — generic message to avoid leaking account status
const { count: deactivatedCount } = await adminSupabase
.from('users')
.select('id', { count: 'exact', head: true })
.eq('email', normalizedEmail)
.eq('is_active', false)

if (deactivatedCount && deactivatedCount > 0) {
return NextResponse.json(
{ error: 'This email is not eligible for registration. Please contact an administrator.' },
{ status: 400 }
)
}

// Check if a fully set-up account already exists (head-only, no data returned)
const { count: existingCount } = await adminSupabase
.from('users')
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chambers",
"version": "1.12.0",
"version": "1.12.1",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
Loading