mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 15:51:01 +08:00
Fix & add profile url thingy
This commit is contained in:
parent
083fae51de
commit
64f4babe95
@ -35,8 +35,8 @@ export default defineEventHandler(async (event) => {
|
|||||||
if (fetchUserInfo.length === 0) {
|
if (fetchUserInfo.length === 0) {
|
||||||
const hashedPassword = await argon2.hash(salt + password);
|
const hashedPassword = await argon2.hash(salt + password);
|
||||||
const createNewUser = await sql`
|
const createNewUser = await sql`
|
||||||
insert into users (uuid, username, passwordhash)
|
insert into users (uuid, username, passwordhash, avatarurl)
|
||||||
values (${uuidv4()}, ${username}, ${hashedPassword})
|
values (${uuidv4()}, ${username}, ${hashedPassword}, ${defaultAvatarUrl})
|
||||||
`;
|
`;
|
||||||
console.log(createNewUser);
|
console.log(createNewUser);
|
||||||
if (fetchUserInfo.length !== 0) {
|
if (fetchUserInfo.length !== 0) {
|
||||||
@ -70,7 +70,7 @@ export default defineEventHandler(async (event) => {
|
|||||||
`;
|
`;
|
||||||
setCookie(event, "token", newToken);
|
setCookie(event, "token", newToken);
|
||||||
return {
|
return {
|
||||||
user: ,
|
user: fetchUserInfoAgain,
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user