has_secure_password isn't just for passwords. Pass it a custom attribute and it'll hash a pin code just fine. Built a passwordless auth system using that and generates_token_for. Magic links and pin codes from one model. dcyoung.dev/shorts/authe...
💡 Authentication Tokens in Rails Without Devise
Magic links are great. You click a link, you're signed in. No password to remember, no password to leak. For most sign-in flows they're probably the ideal solution. ...
dcyoung.dev