Skip to content

Commit

Permalink
block
Browse files Browse the repository at this point in the history
  • Loading branch information
robinElli committed Nov 20, 2023
1 parent 1bee1f1 commit 71db55b
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/routes/authenticated/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
let user
let accessToken
let roles
let isUserBlocked = false
onMount(async () => {
user = get(userStore)
Expand All @@ -38,6 +39,9 @@
} else {
msalUser = {}
}
if(get(userRoles).includes('chatVTFK.block')) {
isUserBlocked = true
}
})
// This function only exists to create a delay for the store to actually get the values.
Expand Down Expand Up @@ -76,7 +80,12 @@
<div class="contentWrapper">
<div class="content">
<h2> Hei, {msalUser.name} 🤓</h2>
<slot></slot>
{#if !isUserBlocked}
<slot></slot>
{:else}
<p>Av ulike grunner er brukeren din blokkert. Mener du at dette er feil kontakt servicedesk 🧑‍💻</p>
{/if}
</div>
</div>
{/await}
Expand Down Expand Up @@ -136,6 +145,17 @@
margin-left: 0.5rem;
}
p {
font-size: larger;
font-style: normal;
font-weight: bold;
padding: 1rem;
display: flex;
justify-content: center;
margin-left: 5rem;
margin-right: 5rem;
}
@media(max-width: 885px) {
.sideNavWrapper {
display: none;
Expand Down

0 comments on commit 71db55b

Please sign in to comment.