Merge pull request 'Fix magic-link sign-in: implicit flow + redirect to /account' (#138) from fix/magic-link-flow into dev
Dev — Build & local smoke test / build-smoke (push) Successful in 2m14s
Dev — Build & local smoke test / build-smoke (push) Successful in 2m14s
This commit was merged in pull request #138.
This commit is contained in:
@@ -11,7 +11,7 @@ fn main() -> Void {
|
|||||||
'use strict';
|
'use strict';
|
||||||
var cfg = window.NEURON_CFG || {};
|
var cfg = window.NEURON_CFG || {};
|
||||||
var sb = supabase.createClient(cfg.supabase_url, cfg.supabase_anon_key, {
|
var sb = supabase.createClient(cfg.supabase_url, cfg.supabase_anon_key, {
|
||||||
auth: { flowType: 'pkce' }
|
auth: { flowType: 'implicit' }
|
||||||
});
|
});
|
||||||
|
|
||||||
window.sendMagicLink = async function() {
|
window.sendMagicLink = async function() {
|
||||||
@@ -25,7 +25,10 @@ fn main() -> Void {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (btn) { btn.disabled = true; btn.textContent = 'Sending...'; }
|
if (btn) { btn.disabled = true; btn.textContent = 'Sending...'; }
|
||||||
var result = await sb.auth.signInWithOtp({ email: email });
|
var result = await sb.auth.signInWithOtp({
|
||||||
|
email: email,
|
||||||
|
options: { emailRedirectTo: window.location.origin + '/account' }
|
||||||
|
});
|
||||||
if (btn) { btn.disabled = false; btn.textContent = 'Continue with email'; }
|
if (btn) { btn.disabled = false; btn.textContent = 'Continue with email'; }
|
||||||
msgEl.style.display = 'block';
|
msgEl.style.display = 'block';
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user