justinmayer / kagi

WebAuthn security keys and TOTP multi-factor authentication for Django
BSD 2-Clause "Simplified" License
91 stars 10 forks source link

Use get_username() instead of hardcoded user.username #42

Closed justinmayer closed 3 years ago

justinmayer commented 3 years ago

If the user model does not contain a username field (as is the case when using email addresses as usernames), referencing user.username results in an error. Since the username variable is already properly set to get_username() earlier in the function, it seems appropriate to use that variable for the authentication success message as well.

justinmayer commented 3 years ago

@natim: Many thanks for looking this over. 😁