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
5 changes: 4 additions & 1 deletion app/auth/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ function mapAuthError(message: string, t: AuthTranslations): string {
async function getOrigin(): Promise<string> {
const h = await headers();
const proto = h.get('x-forwarded-proto') ?? 'https';
const host = h.get('x-forwarded-host') ?? h.get('host') ?? 'reelmark.app';
const host =
h.get('x-forwarded-host') ??
h.get('host') ??
'reelmark-silexio.vercel.app';
return `${proto}://${host}`;
}

Expand Down
2 changes: 1 addition & 1 deletion components/shared/PWAInstallPrompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function PWAInstallPrompt() {
'transition-transform duration-(--duration-slow) ease-apple',
visible
? 'translate-y-0'
: '-translate-y-[200%] pointer-events-none'
: 'translate-y-[-200%] pointer-events-none'
)}
>
<div className="mx-auto max-w-lg glass-bar border-b border-border/60 px-4 py-3 flex items-center gap-3">
Expand Down
2 changes: 1 addition & 1 deletion lib/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SUPPORTED_LANGUAGES } from '@/lib/i18n/config';
import type { Language } from '@/lib/i18n/translations';

export const BASE_URL =
process.env.NEXT_PUBLIC_BASE_URL || 'https://reelmark.app';
process.env.NEXT_PUBLIC_BASE_URL || 'https://localhost:3000';

interface MediaMetadataOptions {
title: string;
Expand Down
22 changes: 9 additions & 13 deletions tests/unit/metadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ describe('buildPageMetadata', () => {

it('sets alternates.canonical when provided', () => {
const meta = buildPageMetadata('Page', 'Desc', {
canonical: 'https://reelmark.app/page',
canonical: `${BASE_URL}/page`,
});
expect(meta.alternates?.canonical).toBe('https://reelmark.app/page');
expect(meta.alternates?.canonical).toBe(`${BASE_URL}/page`);
});

it('omits alternates when canonical is absent', () => {
Expand All @@ -80,12 +80,10 @@ describe('buildMediaMetadata', () => {
expect(meta.description).toBe(
'A team of explorers travel through a wormhole.'
);
expect(meta.alternates?.canonical).toBe(
'https://reelmark.app/en/movie/157336'
);
expect(meta.alternates?.canonical).toBe(`${BASE_URL}/en/movie/157336`);
expect(meta.alternates?.languages).toMatchObject({
en: 'https://reelmark.app/en/movie/157336',
fr: 'https://reelmark.app/fr/movie/157336',
en: `${BASE_URL}/en/movie/157336`,
fr: `${BASE_URL}/fr/movie/157336`,
});
});

Expand Down Expand Up @@ -134,16 +132,14 @@ describe('buildMediaMetadata', () => {
describe('localizedAlternates', () => {
it('builds canonical on the given language with hreflang alternates', () => {
const alt = localizedAlternates('fr', '/movie/157336');
expect(alt.canonical).toBe('https://reelmark.app/fr/movie/157336');
expect(alt.canonical).toBe(`${BASE_URL}/fr/movie/157336`);
expect(alt.languages).toMatchObject({
en: 'https://reelmark.app/en/movie/157336',
fr: 'https://reelmark.app/fr/movie/157336',
en: `${BASE_URL}/en/movie/157336`,
fr: `${BASE_URL}/fr/movie/157336`,
});
});

it('maps the root path to the bare locale prefix', () => {
expect(localizedAlternates('en', '/').canonical).toBe(
'https://reelmark.app/en'
);
expect(localizedAlternates('en', '/').canonical).toBe(`${BASE_URL}/en`);
});
});
Loading