auth.admin.generateLink doesn't generate PKCE-compatible links
@mandarini is already working on this.
Since Nov 6, 2025.
Assessment
This issue has not been assessed yet.
Description
Describe the bug
Trying to generate a PKCE-enabled Magic Link with supabase.auth.admin.generateLink(...) results in a implicit-flow link.
To Reproduce
const email = "user@email.com";
const supabaseAdmin = createClient(
env.NEXT_PUBLIC_SUPABASE_URL,
env.SUPABASE_SERVICE_ROLE_KEY,
{ auth: { flowType: "pkce" } },
);
const { data, error } = await supabaseAdmin.auth.admin.generateLink({
type: "magiclink",
email,
})
return data.properties.action_link;
Expected behavior
I'd expect this to return a PKCE-flow compatible Magic Link in the shape of:
https://xxxxxxxxxxxxxxx.supabase.co/auth/v1/verify?token=pkce_xxxxxxxxxxxxxx&type=magiclink&redirect_to=http://localhost:3000/api/auth/callback
Just like the regular client sends via email when doing.
const { data, error} = await supabase.auth.signInWithOtp({
email,
options: {
emailRedirectTo: redirectURL,
},
});
But instead, the generateLink admin function generates a non-PKCE token (it doesn't start with pkce_).
System information
- OS: Irrelevant
- Browser (if applies): Irrelevant
- Version of supabase-js: 2.45.4
- Version of Node.js: 23.13.1
- Dominant language
- Go
- Stars
- 2.6k
- Forks
- 764
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 39
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/auth
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100