mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-02-21 07:29:37 +01:00
Merge branch 'master' into fix-1267
This commit is contained in:
commit
f7dc60f946
@ -411,10 +411,13 @@ class Auth implements IAuth {
|
||||
}
|
||||
|
||||
async jwtEncrypt(user: RemoteUser, signOptions: JWTSignOptions): string {
|
||||
const { real_groups } = user;
|
||||
const { real_groups, name, groups } = user;
|
||||
const realGroupsValidated = _.isNil(real_groups) ? [] : real_groups;
|
||||
const groupedGroups = _.isNil(groups) ? real_groups : groups.concat(realGroupsValidated);
|
||||
const payload: RemoteUser = {
|
||||
...user,
|
||||
group: real_groups && real_groups.length ? real_groups : undefined,
|
||||
real_groups: realGroupsValidated,
|
||||
name,
|
||||
groups: groupedGroups,
|
||||
};
|
||||
|
||||
const token: string = await signPayload(payload, this.secret, signOptions);
|
||||
|
Loading…
Reference in New Issue
Block a user