You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if there is away to access and parse the response from the $auth.submitLogin() function. I am sending a json abject from my java service which contains the token, the username and last-accessed-time, but when I try to see what I have in the my response in the console I get this: {signedIn: true, configName: "default"} but in the network when I preview my response I see the object I send from my service. How come my two response are different? I am new in all of this (java and angular) it's been like two months that I started jave and a month for angular, and I can't figure out how I can access this response as I want to get that response and have it when I route to another view.
Thank you in advance for the response
The text was updated successfully, but these errors were encountered:
Just in case anybody gets here via a search, I had a similar issue and can offer some insights. Looking at the code, a resolved object of {signedIn: true, configName: "default"} after submit login means that the code wasn't able to extract a user object from the response. It then extends the empty user object to add in the configName and signedIn elements. In my case this was caused by me using a custom json response from the devise-token-auth server side. It turns out that the json response has to be wrapped in an outer data: element. If ng-auth-token doesn't see a data element then it doesn't get the user info. So for example in jBuilder, you would have something like this :
json.data do
json.(@resource,
:id,
:email,
:fullname,
:country_code,
:language_code,
:last_sign_in_at,
:sign_in_count,
:provider,
:uid)
end
Note I'm not great on jBuilder so there may be a more efficient way to that the outer wrapper but you get the point.
Hello there,
I was wondering if there is away to access and parse the response from the
$auth.submitLogin()
function. I am sending a json abject from my java service which contains the token, the username and last-accessed-time, but when I try to see what I have in the my response in the console I get this:{signedIn: true, configName: "default"}
but in the network when I preview my response I see the object I send from my service. How come my two response are different? I am new in all of this (java and angular) it's been like two months that I started jave and a month for angular, and I can't figure out how I can access this response as I want to get that response and have it when I route to another view.Thank you in advance for the response
The text was updated successfully, but these errors were encountered: