Skip to content

Commit

Permalink
fix(console): trying fragments for Rules with hudini
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Jun 24, 2024
1 parent 261bb78 commit bde6cca
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
26 changes: 26 additions & 0 deletions apps/console/src/routes/(app)/profile/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ async function addSecurityKey() {
console.log(key?.id);
}
async function handleElevate() {
const email = $user?.email
if (email) {
const { elevated, isError } = await nhost.auth.elevateEmailSecurityKey(email)
if (elevated) {
// notify
console.log({elevated})
}
if (isError) {
console.log({isError})
}
}
}
// Reactivity
$: meta = {
title: 'Datablocks | Profile',
Expand All @@ -55,6 +70,12 @@ $: meta = {
<span>loading...</span>
{:else}

<h3>Error:</h3>
<section class="rounded-lg bg-slate-50">
<pre>{JSON.stringify(error, null, 2)}</pre>
</section>


<section class="rounded-lg bg-slate-50">
<pre>{JSON.stringify($GetUser.data, null, 2)}</pre>
</section>
Expand Down Expand Up @@ -109,5 +130,10 @@ $: meta = {
</form>
</div>
</section>

<section>
<!-- <span>Elevated permissions: {String(elevated)}</span> -->
<button type="button" class="btn variant-filled" on:click={handleElevate} >Elevate</button>
</section>
</div>

5 changes: 3 additions & 2 deletions apps/console/src/routes/(app)/profile/security-keys.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ export let securityKeys: SecurityKeyFields[];
<pre>{JSON.stringify(securityKeys, null, 2)}</pre>
</section>

<div class="divide-y divide-slate-200">
<!-- fixme: opened issue-->
<!-- <div class="divide-y divide-slate-200">
{#each securityKeys as securityKey (securityKey.id)}
<div transition:fade={defaultDE} animate:flip={defaultDE}>
<SecurityKeyItem {securityKey} />
</div>
{/each}
</div>
</div> -->

0 comments on commit bde6cca

Please sign in to comment.