Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

auth.admin.generateLink not working with PKCE #694

@probablykasper

Description

@probablykasper

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

auth.admin.generateLink() does not seem to work with PKCE.

To Reproduce

const supabaseAdmin = createClient<Database>(
	PUBLIC_SUPABASE_URL,
	SUPABASE_SERVICE_ROLE_KEY,
	{
		auth: {
			autoRefreshToken: false,
			persistSession: false,
			detectSessionInUrl: false,
			flowType: 'pkce',
		},
	}
const link_result = await supabaseAdmin.auth.admin.generateLink({
	email: 'dev@example.com',
	type: 'magiclink',
})
console.log(link_result.data.properties)

Running the above outputs this:

{
  action_link: 'http://localhost:5801/auth/v1/verify?token=be63b5c2adbcb1152b102d51459bdf4df5f1ff47e26d44d0447c6835&type=magiclink&redirect_to=http://localhost:5800',
  email_otp: '840907',
  hashed_token: 'be63b5c2adbcb1152b102d51459bdf4df5f1ff47e26d44d0447c6835',
  redirect_to: 'http://localhost:5800',
  verification_type: 'magiclink'
}

As you can see, the token above doesn't start with pkce_.

Expected behavior

Would expect it to work like supabase.auth.signInWithOtp(), where you get emailed a PKCE token, which does start with pkce_, e.g:

http://localhost:5801/auth/v1/verify?token=pkce_681cbde9a87acc3223cf75c8a068ab56c530bec5855d16457c5254b6&type=magiclink&redirect_to=http://localhost:5800

System information

  • OS: macOS
  • Version of supabase-js: 2.22.0
  • Version of Node.js: 18.14.2

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingreleased

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions