-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
Description
Authority.Ecto.Changeset.put_secure_token/2 would generate a secure, random token into the database.
# Generate a token, and hash it with HMAC before storing it
# (should there be an authority function for unhashing before finding the user by token?)
put_secure_token(changeset, :token)
The original proposal mentions using HMAC to hash the field. It sounds to me like we might want to use an Ecto.Type
@rzane can you shed any light on why we should HMAC after generating the token?
Original: infinitered/authority#11