Skip to content

Commit 0b595a6

Browse files
authored
fix: update OAuth redirect logic to include model thumbnail pages (#1977)
1 parent 75ce129 commit 0b595a6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/hooks.server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export const handle: Handle = async ({ event, resolve }) => {
154154
});
155155
}
156156
} else {
157-
// Redirect to OAuth flow unless on the authorized pages (home, shared conversation, login, healthcheck)
157+
// Redirect to OAuth flow unless on the authorized pages (home, shared conversation, login, healthcheck, model thumbnails)
158158
if (
159159
event.url.pathname !== `${base}/` &&
160160
event.url.pathname !== `${base}` &&
@@ -163,6 +163,10 @@ export const handle: Handle = async ({ event, resolve }) => {
163163
!event.url.pathname.startsWith(`${base}/healthcheck`) &&
164164
!event.url.pathname.startsWith(`${base}/r/`) &&
165165
!event.url.pathname.startsWith(`${base}/conversation/`) &&
166+
!(
167+
event.url.pathname.startsWith(`${base}/models/`) &&
168+
event.url.pathname.endsWith("/thumbnail.png")
169+
) &&
166170
!event.url.pathname.startsWith(`${base}/api`)
167171
) {
168172
refreshSessionCookie(event.cookies, auth.secretSessionId);

0 commit comments

Comments
 (0)