Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dtd
/
civitas.ui
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8156646d
authored
Apr 23, 2025
by
Nabiilah Putri Safa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit middleware
1 parent
9b3cf799
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
middleware/acl.global.ts
views/dstipro/beranda/UserProfileHeader.vue
middleware/acl.global.ts
View file @
8156646
export
default
defineNuxtRouteMiddleware
(
to
=>
{
return
undefined
import
{
defineNuxtRouteMiddleware
,
navigateTo
}
from
"nuxt/app"
import
{
useKeycloakStore
}
from
"~/@core/stores/keycloakStore"
export
default
defineNuxtRouteMiddleware
((
to
)
=>
{
const
keycloakStore
=
useKeycloakStore
()
if
(
process
.
client
)
{
const
isLoginPage
=
to
.
path
===
'/login'
// Jika belum login dan bukan sedang menuju halaman login, redirect ke login
if
(
!
keycloakStore
.
authenticated
&&
!
isLoginPage
)
{
return
navigateTo
(
'/login'
)
}
// Kalau sudah login dan mencoba ke /login, bisa arahkan ke dashboard atau home
if
(
keycloakStore
.
authenticated
&&
isLoginPage
)
{
return
navigateTo
(
'/'
)
// atau ke '/dashboard' misalnya
}
}
})
views/dstipro/beranda/UserProfileHeader.vue
View file @
8156646
...
...
@@ -413,7 +413,7 @@ function openDialog() {
</div>
</VCardText>
<VCardText
<
!-- <
VCardText
v-else
class="d-flex align-bottom flex-sm-row flex-column justify-center gap-x-6"
>
...
...
@@ -486,7 +486,7 @@ function openDialog() {
</VBtn>
</div>
</div>
</VCardText>
</VCardText>
-->
</VCard>
</template>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment