Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CloWM UI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
Computational Metagenomics
CloWM
CloWM UI
Commits
b35a8fb3
Verified
Commit
b35a8fb3
authored
10 months ago
by
Daniel Göbel
Browse files
Options
Downloads
Patches
Plain Diff
Handle invitation links
#121
parent
b5b61432
No related branches found
No related tags found
1 merge request
!118
Resolve "Handle invitation links"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/router/index.ts
+2
-1
2 additions, 1 deletion
src/router/index.ts
src/views/LoginView.vue
+19
-9
19 additions, 9 deletions
src/views/LoginView.vue
with
21 additions
and
10 deletions
src/router/index.ts
+
2
−
1
View file @
b35a8fb3
...
@@ -31,8 +31,9 @@ const router = createRouter({
...
@@ -31,8 +31,9 @@ const router = createRouter({
title
:
"
Login
"
,
title
:
"
Login
"
,
},
},
props
:
(
route
)
=>
({
props
:
(
route
)
=>
({
returnPath
:
route
.
query
.
return_path
??
undefined
,
returnPath
:
route
.
query
.
next
??
undefined
,
loginError
:
route
.
query
.
login_error
??
undefined
,
loginError
:
route
.
query
.
login_error
??
undefined
,
invitationToken
:
route
.
query
.
invitation_token
??
undefined
,
}),
}),
},
},
{
{
...
...
This diff is collapsed.
Click to expand it.
src/views/LoginView.vue
+
19
−
9
View file @
b35a8fb3
...
@@ -11,6 +11,7 @@ const router = useRouter();
...
@@ -11,6 +11,7 @@ const router = useRouter();
const
props
=
defineProps
<
{
const
props
=
defineProps
<
{
returnPath
?:
string
;
returnPath
?:
string
;
loginError
?:
string
;
loginError
?:
string
;
invitationToken
?:
string
;
}
>
();
}
>
();
const
store
=
useUserStore
();
const
store
=
useUserStore
();
...
@@ -24,9 +25,17 @@ onBeforeMount(() => {
...
@@ -24,9 +25,17 @@ onBeforeMount(() => {
}
}
});
});
const
returnPathQuery
=
computed
<
string
>
(()
=>
const
loginPath
=
computed
<
string
>
(()
=>
{
props
.
returnPath
?
`&next=
${
encodeURI
(
props
.
returnPath
)}
`
:
""
,
const
loginUrl
=
new
URL
(
`
${
OpenAPI
.
BASE
}
/auth/login?provider=lifescience`
);
);
console
.
log
(
props
);
if
(
props
.
returnPath
)
{
loginUrl
.
searchParams
.
append
(
"
next
"
,
encodeURI
(
props
.
returnPath
));
}
if
(
props
.
invitationToken
)
{
loginUrl
.
searchParams
.
append
(
"
invitation_token
"
,
props
.
invitationToken
);
}
return
loginUrl
.
href
;
});
onMounted
(()
=>
{
onMounted
(()
=>
{
errorToast
=
new
Toast
(
"
#loginErrorToast
"
);
errorToast
=
new
Toast
(
"
#loginErrorToast
"
);
...
@@ -69,15 +78,16 @@ onMounted(() => {
...
@@ -69,15 +78,16 @@ onMounted(() => {
<div
<div
class=
"card text-center ms-md-auto position-fixed top-50 start-50 translate-middle shadow"
class=
"card text-center ms-md-auto position-fixed top-50 start-50 translate-middle shadow"
>
>
<div
class=
"card-header"
>
Login
</div>
<div
v-if=
"invitationToken"
class=
"card-header"
>
Invitation
</div>
<div
v-else
class=
"card-header"
>
Login
</div>
<div
class=
"card-body"
>
<div
class=
"card-body"
>
<p
class=
"card-text text-secondary"
>
<p
v-if=
"invitationToken"
class=
"card-text text-secondary"
>
Connect your CloWM account with your LifeScience account
</p>
<p
v-else
class=
"card-text text-secondary"
>
Login to this service with LifeScience
Login to this service with LifeScience
</p>
</p>
<a
<a
:href=
"loginPath"
class=
"m-2"
>
:href=
"`${OpenAPI.BASE}/auth/login?provider=lifescience${returnPathQuery}`"
class=
"m-2"
>
<img
src=
"/src/assets/images/ls-login.png"
alt=
"[LS Login]"
/>
<img
src=
"/src/assets/images/ls-login.png"
alt=
"[LS Login]"
/>
</a>
</a>
</div>
</div>
...
...
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