Skip to content

Add accessToken to the current context #743

@bajtos

Description

@bajtos

#337 added support for context-propagation. To make it more useful, loopback.token should save the access token in the context, so that it can be accessed by other parts of the system. At the moment, the token is stored on the req object only:

See lib/middleware/token.js#54.

Proposed solution:

req.accessToken = token || null;
var ctx = loopback.getCurrentContext();
if (ctx) ctx.accessToken = req.accessToken;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions