Skip to content

Commit

Permalink
fix: reverted the format of hash param
Browse files Browse the repository at this point in the history
  • Loading branch information
Silver-IT committed Jul 25, 2024
1 parent 93d4c32 commit 64c7ff1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/controller/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const loginGuard = {

const inviteGuard = {
guard: (to, from) => {
// ex: http://localhost:8000/app/join#groupId=21XWnNRE7vggw4ngGqmQz5D4vAwPYqcREhEkGop2mYZTKVkx8H&secret=5157
// ex: http://localhost:8000/app/join#?groupId=21XWnNRE7vggw4ngGqmQz5D4vAwPYqcREhEkGop2mYZTKVkx8H&secret=5157
return !(to.hash.includes('groupId=') && to.hash.includes('secret='))
},
redirect: (to, from) => ({ path: '/' })
Expand Down
2 changes: 1 addition & 1 deletion frontend/model/contracts/shared/voting/proposals.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function notifyAndArchiveProposal ({ state, proposalHash, proposal, contr
export function buildInvitationUrl (groupId: string, groupName: string, inviteSecret: string, creatorID?: string): string {
const rootGetters = sbp('state/vuex/getters')
const creatorUsername = creatorID && rootGetters.usernameFromID(creatorID)
return `${location.origin}/app/join#${(new URLSearchParams({
return `${location.origin}/app/join#?${(new URLSearchParams({
groupId: groupId,
groupName: groupName,
secret: inviteSecret,
Expand Down
3 changes: 2 additions & 1 deletion test/cypress/integration/group-proposals.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ describe('Proposals - Add members', () => {
cy.getByDT('openAllProposals').click()
cy.get('[data-test="modal"] > .c-container .c-title').should('contain', 'Archived proposals')
cy.getByDT('modal').within(() => {
// NOTE: this is to wait until all of the 4 proposals are loaded inside the modal
cy.get('.c-container > .c-header-info .has-text-1').should('contain', '4 proposals')
assertInvitationLinkFor(2, 'user4')
assertInvitationLinkFor(1, 'user6')
Expand Down Expand Up @@ -389,7 +390,7 @@ describe('Proposals - Add members', () => {
})

it('an invalid invitation link cannot be used', () => {
cy.visit('/app/join#groupId=321&secret=123')
cy.visit('/app/join#?groupId=321&secret=123')
cy.getByDT('pageTitle')
.invoke('text')
.should('contain', 'Oh no! This invite is not valid')
Expand Down

0 comments on commit 64c7ff1

Please sign in to comment.