Skip to content

code 209 invalid session token #4395

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

Closed
akshaychauhan7737 opened this issue Nov 28, 2017 · 2 comments
Closed

code 209 invalid session token #4395

akshaychauhan7737 opened this issue Nov 28, 2017 · 2 comments

Comments

@akshaychauhan7737
Copy link

akshaychauhan7737 commented Nov 28, 2017

i am trying to authenticate session token and fetching user detaild but there is no information about how to do it at : http://docs.parseplatform.org/js/guide/#users
I tried to google it now i got some code but don't know whether the are correct they are not working for me

 var Session = Parse.Object.extend("_Session");
    var sq = new Parse.Query(Session);
    sq.equalTo('sessionToken', userSessionToken)
    sq.include('user');
    console.log(sq);
    sq.find({
        success: function (sessionResult) {
            if (sessionResult.length == 0) {
                //user not found
            } else {
               //user found
            }
        },
        error: function (error) {  console.log(error); callback(false) }
    });

always giving me error

ParseError { code: 209, message: 'This session token is invalid.' }
@flovilmart
Copy link
Contributor

If you want to login as a user from a sessionToken you can use Parse.User.become()

@natanrolnik
Copy link
Contributor

Another option is to pass userSessionToken as the sessionToken parameter in the options:

sq.find({
    sessionToken: userSessionToken,
    success...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants