auth.admin.generateLink does not return proper redirectTo
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- go, javascript
- Domain
- api, authentication, backend
Research direction
Start by tracing the auth.admin.generateLink entry point and its handling of the options.redirectTo value in the Go auth service. Reproduce the magiclink request with the supplied localhost URLs, then verify that the generated link and redirect_to use the provided value rather than the default site URL.
Written by the indexing model from the issue text.
Description
Bug report
Describe the bug
I am using auth.admin.generateLink with type magiclink in an edge function and passing the redirectTo param.
However the generated link does not respect the provided redirectTo param and returns the site url.
To Reproduce
const { data: linkData, error: linkError } =
await supabaseClient.auth.admin.generateLink({
type: "magiclink",
email: email,
options: {
data: {
orga: orga_id,
},
redirectTo: "http://localhost:3000/confirm",
},
});
After triggering the edge function locally this is the response:
[Info] [Generated link: ] http://127.0.0.1:54321/auth/v1/verify?token=9cdd921dc47c0e1b136f3659e6926f45697209047abc95d7964efb67&type=magiclink&redirect_to=http://127.0.0.1:3000/auth/login
[Info] [Generated linkdata: ] {
action_link: "http://127.0.0.1:54321/auth/v1/verify?token=9cdd921dc47c0e1b136f3659e6926f45697209047abc95d7964efb67"... 60 more characters,
email_otp: "275123",
hashed_token: "9cdd921dc47c0e1b136f3659e6926f45697209047abc95d7964efb67",
redirect_to: "http://127.0.0.1:3000/auth/login",
verification_type: "magiclink"
}
Expected behavior
redirect_to should be set to the param provided (http://localhost:3000/confirm) instead of http://127.0.0.1:3000/auth/login
- 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