Good idea but a downright stupid implementation. Imagine you forgot to logout and a malicious actor deleted your account.

User deletion should only happen after an email confirmation has been clicked or the password has been entered.