Closed mdodell closed 2 years ago
Hi, I'm glad you like it! ❤️
You would retrieve the current user in the exact same way as when you use Rodauth in default HTML mode. The account ID is stored in the Rails session just like it is in default mode, which is stored in a cookie by default, there is no separate cookie that Rodauth uses. So, you can use #current_account
on the backend to return the current user.
I'm going to close this, since it's not a bug report. If you have additional questions, please open a topic in discussions.
Hello!
Big fan of the library!
I was wondering if it is possible to get the current user based on the Cookie Based instructions here/some way to have a
refresh
route to return the current user.Additionally, are the cookies configurable in some way (i.e. being able to set
SameSite
andSecure
)?This is important for SPAs that want to make calls to an API that utilizes Rodauth (i.e, making a
/refresh
call upon initial render, that calls the API with the cookies to authenticate the user.