This commit is contained in:
lingdocs 2021-08-26 16:58:52 +04:00
parent 6d2a264295
commit 86766a28f9
2 changed files with 4 additions and 2 deletions

View File

@ -105,7 +105,8 @@ export async function updateLingdocsUser(uuid: T.UUID, toUpdate:
} |
{ userTextOptionsRecord: T.UserTextOptionsRecord } |
{ upgradeToStudentRequest: "waiting" } |
{ upgradeToStudentRequest: "denied" }
{ upgradeToStudentRequest: "denied" } |
{ lastActive: T.TimeStamp }
): Promise<T.LingdocsUser> {
const user = await getLingdocsUser("userId", uuid);
if (!user) throw new Error("unable to update - user not found " + uuid);

View File

@ -17,6 +17,7 @@ import {
} from "../lib/user-utils";
import env from "../lib/env-vars";
import * as T from "../../../website/src/lib/account-types";
import { getTimestamp } from "../lib/time-utils";
export const outsideProviders: ("github" | "google" | "twitter")[] = ["github", "google", "twitter"];
@ -150,7 +151,7 @@ function setupPassport(passport: PassportStatic) {
cb(null, false);
return;
}
const newUser = await insertLingdocsUser(updateLastActive(user));
const newUser = await updateLingdocsUser(userId, { lastActive: getTimestamp() });
cb(null, newUser);
} catch (err) {
cb(err, null);