Compare commits

..

1 commit

Author SHA1 Message Date
164bc09cdd
Merge ee07e4e72d into 6678ded2f9 2024-08-10 08:25:12 +00:00
2 changed files with 0 additions and 16 deletions

View file

@ -50,20 +50,6 @@ export async function GET(context: APIContext): Promise<Response> {
sessionCookie.value,
sessionCookie.attributes
);
await context.locals.runtime.env.DB.prepare(
"UPDATE user SET username = ?2, avatar = ?3, access_token = ?4,access_token_expiration = ?5, refresh_token = ?6 WHERE discord_id = ?1"
)
.bind(
discordUser.id,
discordUser.username,
discordUser.avatar,
tokens.accessToken,
tokens.accessTokenExpiresAt.getTime(),
tokens.refreshToken
)
.first<UserRow>();
return context.redirect("/dashboard");
}

View file

@ -8,8 +8,6 @@ export async function GET(context: APIContext): Promise<Response> {
scopes: ["identify", "guilds"],
});
console.log("login");
context.cookies.set("discord_oauth_state", state, {
path: "/",
secure: import.meta.env.PROD,