🏗️」 wip(auth): added the hability to remove user

This commit is contained in:
2025-10-16 12:29:16 +02:00
parent d80beff543
commit f689274716
4 changed files with 88 additions and 0 deletions

View File

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