Timeline for Cannot use the helper method `current_user` in devise
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 31, 2023 at 4:37 | vote | accept | Tsubasa | ||
Oct 28, 2023 at 5:35 | answer | added | Tsubasa | timeline score: -1 | |
Oct 28, 2023 at 2:44 | comment | added | Tsubasa | To dbugger, thanks for your comments. We are storing session information in redis by the login behavior. I have added part of the user_sessions_controller code for login to the body of the text. These have been confirmed to work. | |
Oct 28, 2023 at 2:42 | history | edited | Tsubasa | CC BY-SA 4.0 |
added 780 characters in body
|
Oct 27, 2023 at 17:16 | comment | added | user229044♦ |
Random thing, but don't put your constants in their own Consts module. You shouldn't do that any more than you would put your classes in their own Classes module, or your variables in a Vars module.
|
|
Oct 27, 2023 at 15:27 | comment | added | dbugger | The current_user is null because the user is not logged in. Rails apis do not use cookies by default -- hence there is no session mechanism to store the logged in user. Usually when using rails as an api, you need to login, get a token and pass that to the front end, and then use that token on all subsequent requests from the front end. The rails api decodes the token and sets the user. | |
S Oct 27, 2023 at 14:08 | review | First questions | |||
Nov 10, 2023 at 14:11 | |||||
S Oct 27, 2023 at 14:08 | history | asked | Tsubasa | CC BY-SA 4.0 | created from wizard |