fix: ensure user insertion is awaited and add debug log for accountability
Some checks failed
Release / Release (push) Has been cancelled
Some checks failed
Release / Release (push) Has been cancelled
This commit is contained in:
@@ -41,7 +41,8 @@ const getUser = async (
|
|||||||
};
|
};
|
||||||
|
|
||||||
const insertUser = async (database: Knex, user: Record<string, any>): Promise<any> => {
|
const insertUser = async (database: Knex, user: Record<string, any>): Promise<any> => {
|
||||||
return database("directus_users").insert(user);
|
await database("directus_users").insert(user);
|
||||||
|
return getUser(database, user.external_identifier, user.provider);
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: optimize this function, reduce the amount of loops
|
// TODO: optimize this function, reduce the amount of loops
|
||||||
@@ -117,6 +118,7 @@ export async function getAccountabilityForToken(
|
|||||||
CacheSet(result.sub, accountability);
|
CacheSet(result.sub, accountability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.debug("Accountability set from database:", accountability);
|
||||||
return accountability;
|
return accountability;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user