Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Frontend
Commits
0b5e6125
Verified
Commit
0b5e6125
authored
3 years ago
by
Erwan Rouchet
Browse files
Options
Downloads
Patches
Plain Diff
Support GitLab OAuth redirection URLs
parent
c068cf3c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1240
Support GitLab OAuth redirection URLs
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
js/router.js
+8
-0
8 additions, 0 deletions
js/router.js
vue/Auth/Profile/Main.vue
+10
-1
10 additions, 1 deletion
vue/Auth/Profile/Main.vue
vue/Tabs.vue
+26
-3
26 additions, 3 deletions
vue/Tabs.vue
with
44 additions
and
4 deletions
js/router.js
+
8
−
0
View file @
0b5e6125
...
...
@@ -267,6 +267,14 @@ const routes = [
component
:
UserProfile
,
meta
:
{
requiresLogin
:
true
}
},
/*
* For compatibility with old GitLab OAuth redirection URLs:
* /process/credentials/ should redirect to the OAuth tab of the user's profile.
*/
{
path
:
'
/process/credentials/
'
,
redirect
:
{
name
:
'
user-profile
'
}
},
{
path
:
'
/group/create
'
,
name
:
'
group-create
'
,
...
...
This diff is collapsed.
Click to expand it.
vue/Auth/Profile/Main.vue
+
10
−
1
View file @
0b5e6125
<
template
>
<main
class=
"container is-fluid"
>
<h1
class=
"title"
>
Your profile and settings
</h1>
<Tabs
:tabs=
"
{ details: 'Details', groups: 'Groups', oauth: 'OAuth' }">
<Tabs
:tabs=
"
{ details: 'Details', groups: 'Groups', oauth: 'OAuth' }"
v-model="tab"
>
<template
v-slot:details
>
<UserInfo
/>
</
template
>
...
...
@@ -27,6 +27,15 @@ export default {
UserInfo
,
Groups
,
OAuthList
},
data
:
()
=>
({
tab
:
'
details
'
}),
beforeRouteEnter
(
to
,
from
,
next
)
{
next
(
vm
=>
{
// When coming from an old GitLab OAuth redirect URL, select the OAuth tab immediately
if
(
to
.
redirectedFrom
===
'
/process/credentials/
'
)
vm
.
tab
=
'
oauth
'
})
}
}
</
script
>
This diff is collapsed.
Click to expand it.
vue/Tabs.vue
+
26
−
3
View file @
0b5e6125
...
...
@@ -6,7 +6,7 @@
v-for=
"(displayName, key) in tabs"
:key=
"key"
:class=
"
{ 'is-active': selected === key }"
v-on:click="select
ed =
key"
v-on:click="select
(
key
)
"
>
<a>
{{
displayName
}}
</a>
</li>
...
...
@@ -50,11 +50,25 @@ export default {
autoHide
:
{
type
:
Boolean
,
default
:
false
},
/**
* Allows using v-model to access or change the currently selected tab in a parent component.
*/
value
:
{
type
:
String
,
default
:
''
}
},
data
:
()
=>
({
selected
:
''
}),
methods
:
{
select
(
tab
)
{
if
(
tab
&&
!
this
.
tabs
[
tab
])
throw
new
Error
(
`Unknown tab
${
tab
}
`
)
this
.
selected
=
tab
this
.
$emit
(
'
input
'
,
tab
)
}
},
watch
:
{
/*
* If the defined tabs change, ensure the selected tab exists or is set to its default empty value
...
...
@@ -62,8 +76,17 @@ export default {
tabs
:
{
immediate
:
true
,
handler
(
newValue
)
{
if
(
!
newValue
)
this
.
selected
=
''
else
if
(
!
newValue
[
this
.
selected
])
this
.
selected
=
Object
.
keys
(
newValue
)[
0
]
if
(
!
newValue
)
this
.
select
(
''
)
else
if
(
!
newValue
[
this
.
selected
])
this
.
select
(
Object
.
keys
(
newValue
)[
0
])
}
},
/*
* Switch tabs if the value was updated from the parent component
*/
value
:
{
immediate
:
true
,
handler
(
newValue
)
{
if
(
this
.
selected
!==
newValue
)
this
.
select
(
newValue
)
}
}
}
...
...
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