mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
fix auth test
This commit is contained in:
@@ -19,7 +19,7 @@ describe("AppAuth", () => {
|
||||
await auth.build();
|
||||
|
||||
const config = auth.toJSON();
|
||||
expect(config.jwt).toBeUndefined();
|
||||
expect(config.jwt.secret).toBeUndefined();
|
||||
expect(config.strategies.password.config).toBeUndefined();
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { type AuthAction, Authenticator, type ProfileExchange, Role, type Strategy } from "auth";
|
||||
import { Exception } from "core";
|
||||
import { Const, StringRecord, Type, transformObject } from "core/utils";
|
||||
import { transformObject } from "core/utils";
|
||||
import {
|
||||
type Entity,
|
||||
EntityIndex,
|
||||
@@ -263,7 +263,17 @@ export class AppAuth extends Module<typeof authConfigSchema> {
|
||||
return this.configDefault;
|
||||
}
|
||||
|
||||
// fixes freezed config object
|
||||
return mergeWith({ ...this.config }, this.authenticator.toJSON(secrets));
|
||||
const obj = {
|
||||
...this.config,
|
||||
...this.authenticator.toJSON(secrets)
|
||||
};
|
||||
|
||||
return {
|
||||
...obj,
|
||||
jwt: {
|
||||
...obj.jwt,
|
||||
fields: this.config.jwt.fields
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user