mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 07:41:02 +08:00
Merge pull request #9 from hpware/beta (Add user idifitying info into the settings system)
Add Beta PR
This commit is contained in:
commit
23823da18b
@ -30,6 +30,11 @@ export default defineEventHandler(async (event) => {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getUserInfo = await sql`
|
||||||
|
SELECT * FROM users
|
||||||
|
WHERE username = ${fetchViaSQL[0].username}
|
||||||
|
`;
|
||||||
|
|
||||||
const tokenDate = new Date(fetchViaSQL[0].created_at);
|
const tokenDate = new Date(fetchViaSQL[0].created_at);
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const dayInMilliseconds = 24 * 60 * 60 * 1000;
|
const dayInMilliseconds = 24 * 60 * 60 * 1000;
|
||||||
@ -43,10 +48,10 @@ export default defineEventHandler(async (event) => {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
userAccount: fetchViaSQL[0].username,
|
userAccount: fetchViaSQL[0].username,
|
||||||
firstName: "",
|
firstName: getUserInfo[0].firstname || "",
|
||||||
requested_action: "CONTINUE",
|
requested_action: "CONTINUE",
|
||||||
current_spot: "KEEP_LOGIN",
|
current_spot: "KEEP_LOGIN",
|
||||||
email: fetchViaSQL[0].email,
|
email: getUserInfo[0].email || "",
|
||||||
avatarURL: fetchViaSQL[0].avatarurl,
|
avatarURL: getUserInfo[0].avatarurl || "",
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user