Merge remote-tracking branch 'origin/main' into user-management

This commit is contained in:
Tzvetan Trave
2025-10-15 13:42:15 +02:00
5 changed files with 39 additions and 8 deletions

View File

@ -0,0 +1,24 @@
import axios from 'axios';
/**
* @param {string} username
* @param {import('fastify').FastifyInstance} fastify
*/
export async function authUserCreate(username, fastify) {
const payload = {
displayName: username,
};
const cookie = fastify.jwt.sign({ user: "admin" });
const url = process.env.USER_URL || "http://localhost:3002/"
await axios.post(
url + "users/" + username,
payload,
{
headers: {
'Cookie': 'token=' + cookie,
},
}
);
}