julianlam / nodebb-plugin-session-sharing

Allows login sessions from your app to persist in NodeBB
MIT License
88 stars 65 forks source link

Update User Groups doesnt remove groups when groups is empty array #74

Closed uplift closed 5 years ago

uplift commented 5 years ago

If a user was previously in one group and is removed via there cookie claims so the groups is an empty array the updateUserGroups function doesnt process the data to force a leave of the previous group due to the userData.groups.length check.

So even though their claims say no groups, the forum still has them in the last group they had.

I think removing the userData.groups.length and maybe replacing it with Array.isArray check should fix the issue. Thought?

https://github.com/julianlam/nodebb-plugin-session-sharing/blob/c41d7681c109926b435169e2b799696eb79f4b95/library.js#L329-L331

julianlam commented 5 years ago

@uplift Yes, that makes sense, will make the appropriate change

julianlam commented 5 years ago

v4.5.0