jeremyevans / rodauth

Ruby's Most Advanced Authentication Framework
http://rodauth.jeremyevans.net
MIT License
1.67k stars 95 forks source link

Fix removing all MFA methods not removing SMS session #235

Closed janko closed 2 years ago

janko commented 2 years ago

On SMS setup and authentication, sms_code is added to the list of methods the session is authenticated by. However, when removing all multifactor authentication methods, Rodauth is removing sms_codes method, which will cause the account authenticated via SMS to stay SMS authenticated. We fix that by removing sms_code method instead.

The method deletion from session when removing all MFA methods wasn't tested for any MFA method (except implicitly for recovery codes), so we add the missing tests.

jeremyevans commented 2 years ago

Thanks for finding and fixing this. I'll merge later today.