Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Custom JWT payload is not set in context.params.payload #682

Closed
DaddyWarbucks opened this issue Jun 12, 2018 · 4 comments
Closed

Custom JWT payload is not set in context.params.payload #682

DaddyWarbucks opened this issue Jun 12, 2018 · 4 comments

Comments

@DaddyWarbucks
Copy link

Steps to reproduce

This repo has a detailed example of the problem. Start the server, navigate to http://localhost:3030 and then look at the node console, which will have detailed output of the problem.
https://github.com/DaddyWarbucks/token-payload

Expected behavior

After creating a custom JWT payload, the context.params.payload will reflect the proper custom payload

Actual behavior

The context.params.payload only has one prop, userId, on it.

@kmorales13
Copy link

Maybe try with:

Object.assign(context.params.payload, { accountId });

@daffl
Copy link
Member

daffl commented Jun 14, 2018

I can confirm that this is a bug with how socket authentication is currently handled. Will be fixed through #517 in the next version.

@PrabhuKathiresan
Copy link

PrabhuKathiresan commented Jan 22, 2019

I could still see that JWT payload is still not set in the context params

As an workaround I am setting the payload in the context params in the before create hooks.

app.service('authentication').hooks({
  before: {
    create(context) {
      context.params.payload = context.data;
    }
  }
});

@daffl
Copy link
Member

daffl commented May 8, 2019

Closing since this should be fixed in Feathers v4 authentication as mentioned.

Please see the migration guide for more information. Closing this issue in order to archive this repository. Related issues can be opened at the new code location in the Feathers main repository.

@daffl daffl closed this as completed May 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants