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
Branches
Tags
2 merge requests!49Product/1442 project invite mngmnt,!48Sprint/2021 09
......@@ -47,8 +47,21 @@ export default Vue.extend({
created() {
this.projectImage = LinkUtil.getScriptPath(pathToAppJs) + projectImagePath;
this.zusatzImage = LinkUtil.getScriptPath(pathToAppJs) + zusatzImagePath;
ProjectApi.getTopLevelProjects(
(response: any) => { for (const datum of response.data) { this.projects.push(datum); } });
// handle possible invitation token
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: {
openCreate() {
......@@ -57,6 +70,10 @@ export default Vue.extend({
redirect(project: any) {
return LinkUtil.getExternalProjectLink(project.slug.toLowerCase());
},
getProjects(){
ProjectApi.getTopLevelProjects(
(response: any) => { for (const datum of response.data) { this.projects.push(datum); } });
},
},
});
</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