Move auth routes in auth subfolder

This commit is contained in:
Andrea Fazzi 2022-10-05 09:26:09 +02:00
parent ee34ef4668
commit 010eab0196
11 changed files with 28 additions and 34 deletions

View file

@ -26,7 +26,6 @@ serve:
base_url: http://kratos:4434/
selfservice:
# default_browser_return_url: http://localhost:4455/ui/welcome
default_browser_return_url: http://localhost:3000/
allowed_return_urls:
- http://localhost:3000
@ -37,31 +36,31 @@ selfservice:
flows:
error:
ui_url: http://localhost:3000/login
ui_url: http://localhost:3000/auth/login
settings:
ui_url: http://localhost:3000/settings
ui_url: http://localhost:3000/auth/settings
privileged_session_max_age: 15m
recovery:
enabled: true
ui_url: http://localhost:3000/recovery
ui_url: http://localhost:3000/auth/recovery
verification:
enabled: true
ui_url: http://localhost:3000/verification
ui_url: http://localhost:3000/auth/verification
after:
default_browser_return_url: http://localhost:3000/
logout:
after:
default_browser_return_url: http://localhost:3000/login
default_browser_return_url: http://localhost:3000/auth/login
login:
ui_url: http://localhost:3000/login
ui_url: http://localhost:3000/auth/login
registration:
ui_url: http://localhost:3000/registration
ui_url: http://localhost:3000/auth/registration
after:
password:
hooks:

View file

@ -8,7 +8,6 @@
if (browser) {
if (_identity.id) {
console.log("signed in");
console.log(_identity);
} else {
console.log("not signed in");
}

View file

@ -8,11 +8,11 @@
<!-- -------------------------------------------------------------------------->
<section id="welcome">
<h2>welcome</h2>
<h1>Probo</h1>
{#if !_identity.id}
<p><a href="{APP}/login">login</a></p>
<p><a href="{APP}/auth/login">Login</a></p>
{:else}
<p><a href="{APP}/dashboard">Dashboard</a></p>
<p><a href="{APP}/dashboard">Dashboard</a></p>
{/if}
</section>

View file

@ -15,25 +15,22 @@
<!-- -------------------------------------------------------------------------->
<div id="login">
{#await pr then dm}
{#if dm.instanceOf === "KratosForm"}
<div id="login">
<h2>Sign in</h2>
{#await pr then dm} {#if dm.instanceOf === "KratosForm"}
<div id="login">
<h2>Sign in</h2>
{#if dm.ui.messages}
<Messages messages={dm.ui.messages} />
{/if}
<Form {dm} groups={["default", "password"]} />
{#if dm.ui.messages}
<Messages messages="{dm.ui.messages}" />
{/if} <Form {dm} groups={["default", "password"]} />
<hr />
<hr />
<div>
<p><a href="{APP}/recovery">Forget password?</a></p>
<p><a href="{APP}/registration">Don't have an account?</a></p>
</div>
</div>
{:else}
<p>Something went wrong</p>
{/if}
{/await}
<div>
<p><a href="{APP}/auth/recovery">Forget password?</a></p>
<p><a href="{APP}/auth/registration">Don't have an account?</a></p>
</div>
</div>
{:else}
<p>Something went wrong</p>
{/if} {/await}
</div>

View file

@ -7,12 +7,11 @@
import Messages from "$lib/components/kratos/messages.svelte";
const flowId = getFlowId($page.url.search);
console.log(browser, flowId);
if (browser && !flowId)
window.location.href = `${KRATOS}/self-service/registration/browser`;
const pr = getDataModels("registration", flowId);
console.log(pr);
</script>
<!-- -------------------------------------------------------------------------->

View file

@ -14,6 +14,6 @@
<h2>Dashboard</h2>
<p>Hello {email}</p>
<p><a href="{APP}/settings">Settings</a></p>
<p><a href="{APP}/logout">Logout</a></p>
<p><a href="{APP}/auth/settings">Settings</a></p>
<p><a href="{APP}/auth/logout">Logout</a></p>
</section>