Skip to content

Commit

Permalink
don't require permissions for oauth verification
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus-Rost committed Jan 24, 2024
1 parent 77a331a commit c8cf898
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functions/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ globalThis.verifyOauthUser = function(state, access_token, settings) {
}
if ( !settings?.channel ) return settings?.fail?.();
var channel = settings.channel;
if ( !channel.permissionsFor(channel.guild.members.me).has([PermissionFlagsBits.ViewChannel, ( channel.isThread() ? PermissionFlagsBits.SendMessagesInThreads : PermissionFlagsBits.SendMessages )]) ) return settings.fail?.();
if ( !settings.interaction && !channel.permissionsFor(channel.guild.members.me).has([PermissionFlagsBits.ViewChannel, ( channel.isThread() ? PermissionFlagsBits.SendMessagesInThreads : PermissionFlagsBits.SendMessages )]) ) return settings.fail?.();
Promise.all([
db.query( 'SELECT logchannel, flags, onsuccess, onmatch, role, editcount, postcount, usergroup, accountage, rename FROM verification LEFT JOIN verifynotice ON verification.guild = verifynotice.guild WHERE verification.guild = $1 AND channel LIKE $2 ORDER BY configid ASC', [channel.guildId, '%|' + ( channel.isThread() ? channel.parentId : channel.id ) + '|%'] ).then( ({rows}) => {
if ( !rows.length ) return Promise.reject();
Expand Down

0 comments on commit c8cf898

Please sign in to comment.