mirror of
https://github.com/KeyZox71/knl_meowscendence.git
synced 2026-01-01 06:06:41 +01:00
「🏗️」 wip(auth): added the hability to remove user
This commit is contained in:
19
src/utils/authUserRemove.js
Normal file
19
src/utils/authUserRemove.js
Normal 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,
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user