I’m now wondering if I even need to / should store the password as the password generation algo will create the same password if generated within the specified time period.
Create a token (the proposed function looks good for me), store it in the database and enable a login with this token.
After login delete the token.
The token should have an expiring date of whatever you want.
Of course this token is not user connected. So the user can share it to others if he wants.
Also it’s pretty easy to create as many token as I want for myself, if I only need to provide an new email address to get a new token. So maybe it’s not really a one time thing in that case.