mirror of
https://github.com/KeyZox71/knl_meowscendence.git
synced 2025-12-31 21:56:41 +01:00
「🔨」 fix: fixed cookie with google callback
This commit is contained in:
@ -37,7 +37,7 @@ export async function gLogCallback(request, reply, fastify) {
|
|||||||
return reply.code(400).send({ error: "User does not exist" });
|
return reply.code(400).send({ error: "User does not exist" });
|
||||||
}
|
}
|
||||||
|
|
||||||
const token = fastify.jwt.sign(user);
|
const token = fastify.jwt.sign({ user: user.username});
|
||||||
|
|
||||||
return reply
|
return reply
|
||||||
.setCookie('token', token, {
|
.setCookie('token', token, {
|
||||||
|
|||||||
@ -49,7 +49,7 @@ export async function gRegisterCallback(request, reply, fastify) {
|
|||||||
|
|
||||||
authUserCreate(user.username, fastify)
|
authUserCreate(user.username, fastify)
|
||||||
|
|
||||||
const token = fastify.jwt.sign(user);
|
const token = fastify.jwt.sign({ user: user.username});
|
||||||
|
|
||||||
return reply
|
return reply
|
||||||
.setCookie('token', token, {
|
.setCookie('token', token, {
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export async function authUserCreate(username, fastify) {
|
|||||||
const url = process.env.USER_URL || "http://localhost:3002/"
|
const url = process.env.USER_URL || "http://localhost:3002/"
|
||||||
|
|
||||||
await axios.post(
|
await axios.post(
|
||||||
"http://localhost:3002/users/" + username,
|
url + "users/" + username,
|
||||||
payload,
|
payload,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
Reference in New Issue
Block a user