mirror of
https://github.com/KeyZox71/knl_meowscendence.git
synced 2026-10-16 12:50:07 +02:00
Merge remote-tracking branch 'origin/main' into user-management
This commit is contained in:
commit
a8e820bcef
5 files changed
+39
-8
No files matched your search
@@ -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,
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user