forked from Yara724/api
added offline inquiry in system setting also fix some bugs
This commit is contained in:
@@ -4,7 +4,12 @@ describe("FanavaranAuthService", () => {
|
||||
const createAuthTokenModel = () => {
|
||||
const store = new Map<
|
||||
string,
|
||||
{ clientKey: string; authenticationToken: string; expiresAt: Date }
|
||||
{
|
||||
clientKey: string;
|
||||
authenticationToken: string;
|
||||
expiresAt: Date;
|
||||
authFingerprint?: string;
|
||||
}
|
||||
>();
|
||||
return {
|
||||
findOne: jest.fn((query: { clientKey: string }) => ({
|
||||
@@ -15,13 +20,20 @@ describe("FanavaranAuthService", () => {
|
||||
findOneAndUpdate: jest.fn(
|
||||
(
|
||||
query: { clientKey: string },
|
||||
update: { $set: { authenticationToken: string; expiresAt: Date } },
|
||||
update: {
|
||||
$set: {
|
||||
authenticationToken: string;
|
||||
expiresAt: Date;
|
||||
authFingerprint?: string;
|
||||
};
|
||||
},
|
||||
) => ({
|
||||
exec: async () => {
|
||||
const next = {
|
||||
clientKey: query.clientKey,
|
||||
authenticationToken: update.$set.authenticationToken,
|
||||
expiresAt: update.$set.expiresAt,
|
||||
authFingerprint: update.$set.authFingerprint,
|
||||
};
|
||||
store.set(query.clientKey, next);
|
||||
return next;
|
||||
|
||||
Reference in New Issue
Block a user