Fix invites with relative server

This commit is contained in:
Travis Shivers 2020-07-22 14:59:10 -05:00
parent 41cf946888
commit c8ba6459e2
No known key found for this signature in database
GPG Key ID: EE4CC2891B8FCD33
4 changed files with 9 additions and 4 deletions

View File

@ -263,10 +263,14 @@ export default {
const invitePart = this.$router.resolve({
name: 'join',
params: { server: this.GET_SERVER, room: this.GET_ROOM, password: this.GET_PASSWORD },
params: {
...(this.GET_SERVER.length > 0 && { server: this.GET_SERVER }),
room: this.GET_ROOM,
password: this.GET_PASSWORD,
},
}).href;
return `${window.location.origin}/${invitePart}`;
return new URL(invitePart, window.location).toString();
}
return '';
},

View File

@ -37,7 +37,7 @@ export default new Router({
},
{
path: '/join/:server/:room/:password?',
path: '/join/:server?/:room/:password?',
meta: {
requiresAuth: true,
redirectAfterAuth: true,

View File

@ -60,7 +60,7 @@ export default {
props: {
server: {
type: String,
required: true,
default: '',
},
room: {

View File

@ -15,6 +15,7 @@ try {
// Sometimes on CI stuff they build with .git being present
// TODO: find better way to do this
process.env.VUE_APP_GIT_DATE = new Date().toISOString();
console.log('env', process.env);
if (process.env.SOURCE_COMMIT) {
process.env.VUE_APP_GIT_HASH = process.env.SOURCE_COMMIT.substring(0, 7);