Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discord Auth error! #474

Open
unseenmagik opened this issue Feb 21, 2023 · 0 comments
Open

Discord Auth error! #474

unseenmagik opened this issue Feb 21, 2023 · 0 comments

Comments

@unseenmagik
Copy link
Collaborator

When using an array of multiple discord guildId and roleId within the config, we have the below error

1|leaderboard  | TypeError: Cannot read properties of undefined (reading 'some')
1|leaderboard  | [next] Magik tried to login: {"hasError":true,"hasRole":false,"isMemberOfGuild":false,"areGuildIdsConfigured":true,"areRoleIdsConfigured":true,"finaleDecision":false}

Adding logging console.log({ member }); shows the error of:
[next] { member: { message: 'Unknown Guild', code: 10004 } }

This happens when a user is in more than 1 guild but does not have all the roleId's allocated to them represented in each guild.

Example:
User 1 > Guild 1 = roleId & guildId in config
User 1 > Guild 2 = Only a member (no roleId assigned thats defined in config)
User 1 > Guild 3 = Only a member (no roleId assigned thats defined in config)

Appears that if a guildId is set, and your member is in the server, it requires you to have the role in roleId

Fix:
Compare user to guilds (If in guild, check role) if any roleId match's then grant access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant