Skip to content

AcessToken.verify is not working #328

@dpmango

Description

@dpmango

Hey!
Im following the video guide pt.3 and spend some time figuring out why destroying access token return Your access token is invalid. no matter how hard I try.

I have used following DELETE request and token was valid and have all user attributes.
http://localhost:3000/api/access_tokens/1/?access_token=xxxxxxx

After going a bit deeper into code and loging params I found out that verify method gets undefined on logging into console params.auth.access_token

static verify(params, callback) {
    this.query()
      .join('user')
      .where({
         access_token: params.auth.access_token,
         expires_at__gte: new Date()
       })
     .........

Instead I managed my issue with modified params.body.access_token and therefore passing access_token as param.

      .where({
        access_token: params.body.access_token,
        expires_at__gte: new Date()
      })

Something to do with params.auth ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions