Skip to content

revokeRefreshToken not working #360

Open
@planetwebsolution

Description

@planetwebsolution

Hi, I am writing the logic for revokeRefreshToken. I'm trying to generate access token from the refresh_token but it was not working. What should revokeRefreshToken function return in case of success refresh token deletion ? I am having this code

model.revokeRefreshToken = function (token, callback) {

    return SaveRefreshToken.findOne({
        where: {
            refresh_token: token
        }
    }).then(function (rT) {

        if (!rT)
            return callback(null, 0);

        var token = rT.dataValues;

        if (rT)
            rT.destroy();
        callback(null, token);
    }).catch(function (err) {
        console.log("revokeToken - Err: ", err)
    });
}

This logic was successfully deleting refresh_token record from the db but not generating any new token for the same. Any suggestion will help me out

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions