File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -104,8 +104,10 @@ export default class GroupManager extends BaseManager<Group> implements GroupMan
104
104
if ( shareToken !== undefined ) {
105
105
return await this . joinWithToken ( inviteLinkOrGroupID , shareToken )
106
106
} else {
107
- const urlPath = new URL ( inviteLinkOrGroupID ) . pathname
108
- const matches = urlPath . match ( / .+ \/ ( \d + ) \/ ( [ A - Z a - z 0 - 9 ] + ) $ / )
107
+ const inviteURL = new URL ( inviteLinkOrGroupID )
108
+ if ( ! inviteURL . hostname . endsWith ( 'groupme.com' ) )
109
+ throw new Error ( `Invalid invite link\n-- URL: ${ inviteLinkOrGroupID } ` )
110
+ const matches = inviteURL . pathname . match ( / .+ \/ ( \d + ) \/ ( [ A - Z a - z 0 - 9 ] + ) $ / )
109
111
if ( matches === null ) throw new Error ( `Invalid invite link\n-- URL: ${ inviteLinkOrGroupID } ` )
110
112
return await this . joinWithToken ( matches [ 1 ] , matches [ 2 ] )
111
113
}
You can’t perform that action at this time.
0 commit comments