41.gif

Search (advanced search)
Use this Search form before posting, asking or make a new thread.
Tips: Use Quotation mark to search words (eg. "How To Make Money Online")

12-07-2022, 04:03 AM
Post: #1
Ruby Devise: Inconsistency in current_user in API controller VS. Pre-existing controller
Hello Everyone,

I have started Ruby Training, But I can't able to solve this code.

I'm attempting to access current_user from a custom API controller as shown below:

PHP Code:
class Api::V1::UserProfileController ApplicationController
def index
puts current_user
.inspect
end
private
def set_default_format
request
.format = :json
end
end 

To give a bit of context. I'm integrating React into an already existing project. I'm attempting to get the current user that is logged in. But this always returns as nil and when user_signed_in? the method is called, it's always false. However, I'm able to get current_user from the Users Controller. So I feel as though there is an inconsistency in the session. How can I access current_user from the API controller that reflects the state on other controllers?
12-15-2022, 03:37 PM
Post: #2
Cybersecurity: Recognize Risks and Stop Attacks
Hello everyone,

I am new person in Cybersecurity course. I don't have any experience what kind of cyber security course will be beneficial to me.

There are various course in cybersecurity and I confuse what kind of course doing in it. I have suffer problem in to be hack and slow the system to be work not in properly way.




26.gif
Free counters!