0xSina
0xSina

Reputation: 21593

Rails API access_token

I am creating an API using rails. When a user logs in (passes in username/password), rather than setting a cookie, I want to respond with a 'token' that I want to send the client. This token probably has an expiration date on it and the user_id i store internally which links the token with the user, etc. Is there a tutorial or gem I can use? Thanks

Upvotes: 0

Views: 82

Answers (2)

Anand Shah
Anand Shah

Reputation: 14913

Railscasts.com has a wonderful episode dedicated to the same issue, worth checking it out.

Upvotes: 1

yoones
yoones

Reputation: 2474

If you're just looking for a way to send a token (not a gem that takes care of the whole process), you can use render inline: "token" (or a json equivalent)

Upvotes: 0

Related Questions