There is one tiny issue with this approach.
Your method forces storage of the password cleartext on the server which is strongly discouraged.
You should always store the password on the server as a hash of some kind to protect your users against breaches on your side.