-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/validate_token #148
Comments
Loot at the source here. You just need to hit this route like all the other request : with the require header to authenticate your users. |
Sorry, I dont understand. what is the require header? |
I invite you to read the doc. |
I have read the doc lots of times. I just don't understand how to get this route working. I have the others working.... |
I have a tokens field in my db
am i supposed to send one of these to this endpoint? |
You call this route like all the other one : with the headers described on the doc (access-token, uid ...) |
So you send the access-token you get in the headers back to this endpoint? |
try it |
Hi @maxrosecollins - I tried to explain the token handling aspect of this gem here. Please let me know if this explanation is unclear. The values stored in the
Adding to that, the tokens are changed at the end of each request and sent back to the client using the header keys describe here ( |
I understand it a bit more now, thanks! So when do i need to use the /validate_token end point? Thanks again |
If you use If you don't use it, you should call this route when you need to know if the user's token is not expired :) |
I'm using react not angular so I cant use that module. |
@lynndylanhurley thinking of writing a react component anytime soon? ;) |
Can I have you opinion on ReactJS vs AngularJS ? I'm amaze by ReactNative :p |
I like it, still getting to grips with it though. I have tried both, and personally I like react more, I think there are fewer concepts to learn with react then with angular. I just feel I understand react more. I think angular is good for building a simple example of something but when you want to scale big and write lots of custom directives it gets harder. What do you think of them? |
I never use it. Yet. I learn AngularJS because it was a requirement for one of my client, and I still offer my service on AngularJS development. But, after the Facebook conference on ReactNative, I'm really excited to work with it ! |
Yeah react native looks really good. React seems to make more sense to me than angular. Just frustrating there isn't a ng-token-auth for react :( |
Well, you can create it if you want :D
|
I suppose i'm going to have to try. Not sure i'm good enough though. |
Well, do it step by step. You can started with just the login and register functions and add the others features later |
True, I do have login and register working at the moment! I'll give it a go. |
I have been thinking of writing a React component actually. I'd like to break out the logic from this module into a core package, and then create framework specific modules / components / plugins that wrap the core. No ETA on that tho. |
Yeah that would be awesome! |
Can you show me how you do that in react ?
|
Id just like to call to attention that, based on the README, its not easy to answer @maxrosecollins question:
I have some general assumptions about it, but Im trying to give an authoritative answer to a fellow developer who is using my API for a mobile app, and its very difficult to do by just reading the source code or the README document. @nicolas-besnard answer was basically what I was assuming:
Ill interpret this as, you only need to use I think a small note in the README about this endpoint and its implied uses, and any further information you have on it, would be very helpful to us adopters of Thanks! |
I realize this is an old thread, but it is unfortunate there was not an action item that came from it. I spent more time than I care to admit thinking this is a feature similar to a refresh token, where in fact it's not. If you already handle 401 from the server in your client app by routing users to the login and resetting their session, then there doesn't seem to be much point at all (at least IMHO) for this endpoint. I greatly appreciate @stratigos summary. |
How am I supposed to use this end point? it says 'Accepts uid and auth_token as params' and that these are in the db, I dont have a db field called auth_token, I have tokens?
The text was updated successfully, but these errors were encountered: