这是indexloc提供的服务,不要输入任何密码
Skip to content

put_secure_token/2 #4

@danielberkompas

Description

@danielberkompas

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

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions