mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-31 09:10:44 +08:00
Improve session handling for SIWE
Signed-off-by: Sebastian Martinez <sebastinez@me.com>
This commit is contained in:
+1
-1
@@ -89,7 +89,7 @@
|
||||
</Route>
|
||||
<Registrations {config} session={$session} />
|
||||
<Orgs {config} />
|
||||
<Seeds {config} />
|
||||
<Seeds {config} session={$session} />
|
||||
<Faucet {config} />
|
||||
<Users />
|
||||
<Resolver {config} />
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
import { Route } from "svelte-routing";
|
||||
import View from '@app/base/seeds/View.svelte';
|
||||
import type { Config } from '@app/config';
|
||||
import type { Session } from "@app/session";
|
||||
|
||||
export let config: Config;
|
||||
export let session: Session | null;
|
||||
</script>
|
||||
|
||||
<Route path="/seeds/:seed" let:params>
|
||||
<View {config} host={params.seed}/>
|
||||
<View {config} {session} host={params.seed}/>
|
||||
</Route>
|
||||
|
||||
@@ -7,18 +7,19 @@
|
||||
import NotFound from "@app/NotFound.svelte";
|
||||
import Clipboard from "@app/Clipboard.svelte";
|
||||
import Projects from "@app/base/orgs/View/Projects.svelte";
|
||||
import { session } from "@app/session";
|
||||
import type { Session } from "@app/session";
|
||||
import Address from "@app/Address.svelte";
|
||||
import SiweConnect from "@app/SiweConnect.svelte";
|
||||
import type { SeedSession } from "@app/siwe";
|
||||
|
||||
export let config: Config;
|
||||
export let session: Session | null;
|
||||
export let host: string;
|
||||
|
||||
let siweSession: SeedSession | null = null;
|
||||
|
||||
$: if ($session?.siwe) {
|
||||
const entries = Object.entries($session.siwe);
|
||||
$: if (session?.siwe) {
|
||||
const entries = Object.entries(session.siwe);
|
||||
const result = entries.find(([, session]) => session.domain === host);
|
||||
if (result) {
|
||||
siweSession = result[1];
|
||||
@@ -122,7 +123,7 @@
|
||||
<!-- User Session -->
|
||||
<div class="label">Connection</div>
|
||||
<div>
|
||||
{#if $session?.signer}
|
||||
{#if session?.signer}
|
||||
{#if siweSession}
|
||||
<div class="desktop">
|
||||
<Address address={siweSession.address} {config} resolve />
|
||||
|
||||
Reference in New Issue
Block a user