Skip to content

fix supabase url and ios issue#76

Merged
XploY04 merged 1 commit into
pointblank-club:stagingfrom
Hemang360:iosndb
May 27, 2026
Merged

fix supabase url and ios issue#76
XploY04 merged 1 commit into
pointblank-club:stagingfrom
Hemang360:iosndb

Conversation

@Hemang360

@Hemang360 Hemang360 commented Sep 4, 2025

Copy link
Copy Markdown
Contributor

Summary: What does this PR do?

Resume was not opening in Safari browser as it was opening as a popup and popups are blocked in safari by default. Also, when someone opens a resume, the supabase url was visible which is not a good thing.
Fixed these issues.

Which issue(s) this PR fixes:

Changes Made

Describe the changes you've made in this PR:

  • Feature implementation
  • Bug fix
  • Documentation update
  • Code refactoring
  • Configuration changes
  • Other (please specify)

Type of Change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update
  • Performance improvement
  • Code cleanup or refactor

How Has This Been Tested?

Describe the tests you ran:

  • Unit tests
  • Integration tests
  • Manual tests
  • Other (please specify)

Please describe the test cases and expected behavior:
1.
2.

Screenshots (if applicable)

Dependencies

Documentation

  • I have updated the documentation accordingly
  • Documentation update is not required

Comments:

Reviewer Notes

@netlify

netlify Bot commented Sep 4, 2025

Copy link
Copy Markdown

Deploy Preview for pb-placement ready!

Name Link
🔨 Latest commit f71194a
🔍 Latest deploy log https://app.netlify.com/projects/pb-placement/deploys/68b9f42ae05c3c0008a67630
😎 Deploy Preview https://deploy-preview-76--pb-placement.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added Frontend Auto-generated label for Frontend changes size-M Auto-generated label for size-M changes labels Sep 4, 2025
@XploY04 XploY04 requested a review from Copilot May 26, 2026 18:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a resume “view” proxy endpoint and updates the UI/middleware to (1) avoid exposing the raw Supabase storage URL to end-users and (2) improve resume opening behavior on Safari/iOS (where popups are often blocked).

Changes:

  • Added /api/resume/view/[memberId] to proxy resume PDF access through the app domain.
  • Updated resume UI to use the proxy URL and to open resumes differently on mobile/iOS vs desktop (modal iframe).
  • Updated middleware and export endpoint to account for the new proxy route.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
middleware.ts Bypasses auth redirects for the new resume proxy route.
components/profile/resume-section.tsx Uses proxy URL for viewing/downloading resumes; adds mobile/iOS handling logic.
app/profile/[id]/page.tsx Passes userId into ResumeSection to enable proxy URL construction.
app/api/resume/view/[memberId]/route.ts New proxy endpoint that fetches the upstream resume and serves it with PDF headers.
app/api/export/pdf/route.ts Returns the proxy URL instead of the raw member.resume_url.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread middleware.ts
Comment on lines 23 to +27
const pathname = req.nextUrl.pathname;

if (pathname.startsWith('/api/resume/view')) {
return res;
}
Comment on lines 462 to 465
<ResumeModal
resumeUrl={file.publicUrl}
fileName={file.name}
resumeUrl={userId ? `/api/resume/view/${userId}` : file.publicUrl}
displayName={displayFileName || file.name}
/>
Comment on lines 467 to 469
<Button variant="ghost" size="sm" asChild>
<a href={file.publicUrl} download={displayFileName || file.name}>
<a href={userId ? `/api/resume/view/${userId}` : file.publicUrl} download={displayFileName || file.name}>
<Download className="h-4 w-4" />
Comment on lines +37 to +41
if (!member || !resumeUrl) {
return NextResponse.json({ message: 'Resume not found' }, { status: 404 });
}

const upstream = await fetch(resumeUrl);
Comment on lines +46 to +53
let filename = 'resume.pdf';
try {
const url = new URL(resumeUrl);
const pathParts = url.pathname.split('/');
const lastPart = pathParts[pathParts.length - 1];
if (lastPart && lastPart.includes('.pdf')) {
filename = lastPart;
} else {
Comment on lines +15 to +23
export async function HEAD(_req: NextRequest, { params }: { params: { memberId: string } }) {
try {
const { memberId } = params;
if (!memberId) return new NextResponse(null, { status: 400 });

const { resumeUrl } = await getMemberAndUrl(memberId);
if (!resumeUrl) return new NextResponse(null, { status: 404 });

return new NextResponse(null, { status: 200 });
@XploY04 XploY04 merged commit de83bce into pointblank-club:staging May 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend Auto-generated label for Frontend changes size-M Auto-generated label for size-M changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants