Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
idatt2106-2024-07
frontend
Commits
72188822
Commit
72188822
authored
11 months ago
by
VIktorGrev
Browse files
Options
Downloads
Patches
Plain Diff
feat: Adding iAuth in routing
parent
87bf31fe
No related branches found
No related tags found
No related merge requests found
Pipeline
#274961
failed
11 months ago
Stage: install_dependencies
Stage: lint
Stage: build_project
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/UserProfile/UserProfileLayout.vue
+0
-2
0 additions, 2 deletions
src/components/UserProfile/UserProfileLayout.vue
src/router/index.ts
+13
-19
13 additions, 19 deletions
src/router/index.ts
with
13 additions
and
21 deletions
src/components/UserProfile/UserProfileLayout.vue
+
0
−
2
View file @
72188822
...
...
@@ -18,7 +18,6 @@ function toRoadmap(){
</
script
>
<
template
>
<Menu></Menu>
<div
class=
"container text-center"
>
<div
class=
"row"
>
<div
class=
"col"
>
...
...
@@ -120,7 +119,6 @@ function toRoadmap(){
</div>
</div>
</div>
<Footer></Footer>
</
template
>
<
style
scoped
>
...
...
This diff is collapsed.
Click to expand it.
src/router/index.ts
+
13
−
19
View file @
72188822
...
...
@@ -17,10 +17,9 @@ const routes = [
path
:
''
,
name
:
'
home
'
,
component
:
()
=>
import
(
'
../views/HomeView.vue
'
),
meta
:
{
requiresAuth
:
true
},
},
{
path
:
'
/
news
'
,
path
:
'
news
'
,
name
:
'
news
'
,
component
:
()
=>
import
(
'
@/views/NewsView.vue
'
),
},
...
...
@@ -49,11 +48,16 @@ const routes = [
name
:
'
shop
'
,
component
:
()
=>
import
(
'
@/views/ShopView.vue
'
),
},
{
path
:
'
/profile
'
,
name
:
'
profile
'
,
component
:
UserProfileView
},
{
path
:
'
admin
'
,
name
:
'
admin
'
,
component
:
()
=>
import
(
'
@/views/TestView.vue
'
),
meta
:
{
requiresAdmin
:
true
}
meta
:
{
requiresAdmin
:
true
}
,
},
{
path
:
'
unauthorized
'
,
...
...
@@ -72,11 +76,6 @@ const routes = [
name
:
'
login
'
,
component
:
LoginView
,
},
{
path
:
'
/profile
'
,
name
:
'
profile
'
,
component
:
UserProfileView
},
{
path
:
'
/sign-up
'
,
name
:
'
sign up
'
,
...
...
@@ -135,18 +134,13 @@ router.beforeEach((to, from, next) => {
const
userRole
=
user
.
role
;
const
isAuthenticated
=
user
.
isLoggedIn
;
/*if (requiresAuth && !isAuthenticated) {
next({ name: 'login' });
if
(
requiresAuth
&&
!
isAuthenticated
)
{
next
({
name
:
'
login
'
,
query
:
{
redirect
:
to
.
fullPath
}
});
}
else
if
(
requiresAdmin
&&
userRole
!==
'
admin
'
)
{
next
({
name
:
'
home
'
});
}
else
{
if (requiresAdmin && userRole !== 'admin') {
next({ name: 'unauthorized' });
} else {
next();
}
}*/
next
();
next
();
}
});
export
default
router
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment