Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update authentication options in createServerClient #60

Closed
wants to merge 2 commits into from
Closed
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
Binary file added bun.lockb
Binary file not shown.
11 changes: 2 additions & 9 deletions src/createServerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@ import type {
} from "@supabase/supabase-js/dist/module/lib/types";

import { VERSION } from "./version";
import {
DEFAULT_COOKIE_OPTIONS,
combineChunks,
createChunks,
deleteChunks,
isBrowser,
isChunkLike,
} from "./utils";

import { createStorageFromOptions, applyServerStorage } from "./cookies";
import type {
CookieOptionsWithName,
Expand Down Expand Up @@ -170,11 +163,11 @@ export function createServerClient<
...(options?.cookieOptions?.name
? { storageKey: options.cookieOptions.name }
: null),
...options?.auth,
flowType: "pkce",
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like it'd no longer be possible to override persistSession , autoRefreshToken etc.. with user supplied options after this change. Not sure if we'd want that

Let me know if I've misunderstood the change though.

autoRefreshToken: false,
detectSessionInUrl: false,
persistSession: true,
...options?.auth,
Copy link
Author

Choose a reason for hiding this comment

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

It would, currently is it not possible

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right, it would make it configurable. I'm still not sure it'll fix the concern around a service role client though. Let's complete discussing the issue on the thread and circle back to this PR if needed

storage,
},
},
Expand Down
Loading