API Authentication for user logged in to a Web App server

前端 未结 5 906
忘了有多久
忘了有多久 2020-12-02 19:40

I am building a Web App and a separate API (so that users can share their collected data with someone if they want to) using Ruby on Rails. The users can log in on the web a

5条回答
  •  生来不讨喜
    2020-12-02 20:05

    Rails uses sessions to keep track of the state of a user, which is stored in the user's cookies.

    The documentation for sessions can be found here

    If you leverage an authentication system such as Devise, you will have access to a current_user method in your controllers as well as a ton of different helpers which you can leverage, depending on your specific needs

提交回复
热议问题