README.md in doorkeeper-jwt-0.1.0 vs README.md in doorkeeper-jwt-0.1.1
- old
+ new
@@ -36,16 +36,16 @@
Doorkeeper::JWT.configure do
# Set the payload for the JWT token. This should contain unique information
# about the user.
# Defaults to a randomly generated token in a hash
# { token: "RANDOM-TOKEN" }
- payload do
+ token_payload do |opts|
+ user = User.find(opts[:resource_owner_id])
+
{
user: {
- id: 123,
- first_name: "Jane",
- last_name: "Doe",
- email: "jdoe@example.com"
+ id: user.id,
+ email: user.email
}
}
end
# Set the encryption secret. This would be shared with any other applications