Skip to content

Commit

Permalink
added keycloak auth and roles
Browse files Browse the repository at this point in the history
added keycloak sign in auth in frontend. added 3 roles and navigation guards from the roles
  • Loading branch information
nk-randers committed Dec 11, 2024
1 parent 114f603 commit 8d5d3ce
Show file tree
Hide file tree
Showing 12 changed files with 496 additions and 202 deletions.
2 changes: 2 additions & 0 deletions vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
},
"dependencies": {
"axios": "^1.5.1",
"dotenv": "^16.4.7",
"keycloak-js": "^26.0.7",
"vue": "^3.3.4",
"vue-router": "^4.2.5"
},
Expand Down
12 changes: 6 additions & 6 deletions vue/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<script setup>
import { ref } from 'vue';
import Header from './components/Menu.vue';
import SignInButton from './components/SignInButton.vue';
import Header from './components/Menu.vue'
const headerComponent = ref(null)
const currentComponent = ref(null)
const headerComponent = ref(null);
const currentComponent = ref(null);
const setHeaderAlert = (headerItemTitle, alertText) => {
headerComponent.value.setAlert(headerItemTitle, alertText)
headerComponent.value.setAlert(headerItemTitle, alertText);
};
</script>

<template>

<header>
<div id="logo-container">
<svg id="logo" class="desktop-only w-196px" viewBox="0 0 243 36" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
Expand All @@ -21,14 +21,14 @@ const setHeaderAlert = (headerItemTitle, alertText) => {
<span class="logo-subtext semi-bold uppercase desktop-only">Onboardingmodul</span>
</div>
<Header ref="headerComponent" />
<SignInButton />
</header>

<main>
<div class="content">
<router-view ref="currentComponent" @onHeaderAlert="setHeaderAlert"></router-view>
</div>
</main>

</template>

<style scoped>
Expand Down
Loading

0 comments on commit 8d5d3ce

Please sign in to comment.