mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: logout if myAppStateKeyId not present
This commit is contained in:
@@ -396,7 +396,7 @@ export const makeSocket = ({
|
||||
)
|
||||
|
||||
/** logout & invalidate connection */
|
||||
const logout = async() => {
|
||||
const logout = async(msg?: string) => {
|
||||
const jid = authState.creds.me?.id
|
||||
if(jid) {
|
||||
await sendNode({
|
||||
@@ -419,7 +419,7 @@ export const makeSocket = ({
|
||||
})
|
||||
}
|
||||
|
||||
end(new Boom('Intentional Logout', { statusCode: DisconnectReason.loggedOut }))
|
||||
end(new Boom(msg || 'Intentional Logout', { statusCode: DisconnectReason.loggedOut }))
|
||||
}
|
||||
|
||||
ws.on('message', onMessageRecieved)
|
||||
|
||||
Reference in New Issue
Block a user