Skip to content
Snippets Groups Projects
Commit 7386327e authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

New: Included token handling (coscine/issues#1529)

parent 395499fd
No related branches found
No related tags found
2 merge requests!49Product/1442 project invite mngmnt,!48Sprint/2021 09
...@@ -47,8 +47,21 @@ export default Vue.extend({ ...@@ -47,8 +47,21 @@ export default Vue.extend({
created() { created() {
this.projectImage = LinkUtil.getScriptPath(pathToAppJs) + projectImagePath; this.projectImage = LinkUtil.getScriptPath(pathToAppJs) + projectImagePath;
this.zusatzImage = LinkUtil.getScriptPath(pathToAppJs) + zusatzImagePath; this.zusatzImage = LinkUtil.getScriptPath(pathToAppJs) + zusatzImagePath;
ProjectApi.getTopLevelProjects( // handle possible invitation token
(response: any) => { for (const datum of response.data) { this.projects.push(datum); } }); let token = GuidUtil.getUrlParam("token");
if (GuidUtil.isValidGuid(token)) {
ProjectApi.resolveInvitation(token,
(response: any) => {
if (window.history.pushState) {
let newurl = window.location.protocol + '//' + window.location.host + window.location.pathname;
window.history.pushState({ path: newurl }, '', newurl);
}
this.getProjects();
},
(error: any) => { this.getProjects(); });
} else {
this.getProjects();
}
}, },
methods: { methods: {
openCreate() { openCreate() {
...@@ -57,6 +70,10 @@ export default Vue.extend({ ...@@ -57,6 +70,10 @@ export default Vue.extend({
redirect(project: any) { redirect(project: any) {
return LinkUtil.getExternalProjectLink(project.slug.toLowerCase()); return LinkUtil.getExternalProjectLink(project.slug.toLowerCase());
}, },
getProjects(){
ProjectApi.getTopLevelProjects(
(response: any) => { for (const datum of response.data) { this.projects.push(datum); } });
},
}, },
}); });
</script> </script>
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment