more
This commit is contained in:
parent
6d2a264295
commit
86766a28f9
|
@ -105,7 +105,8 @@ export async function updateLingdocsUser(uuid: T.UUID, toUpdate:
|
||||||
} |
|
} |
|
||||||
{ userTextOptionsRecord: T.UserTextOptionsRecord } |
|
{ userTextOptionsRecord: T.UserTextOptionsRecord } |
|
||||||
{ upgradeToStudentRequest: "waiting" } |
|
{ upgradeToStudentRequest: "waiting" } |
|
||||||
{ upgradeToStudentRequest: "denied" }
|
{ upgradeToStudentRequest: "denied" } |
|
||||||
|
{ lastActive: T.TimeStamp }
|
||||||
): Promise<T.LingdocsUser> {
|
): Promise<T.LingdocsUser> {
|
||||||
const user = await getLingdocsUser("userId", uuid);
|
const user = await getLingdocsUser("userId", uuid);
|
||||||
if (!user) throw new Error("unable to update - user not found " + uuid);
|
if (!user) throw new Error("unable to update - user not found " + uuid);
|
||||||
|
|
|
@ -17,6 +17,7 @@ import {
|
||||||
} from "../lib/user-utils";
|
} from "../lib/user-utils";
|
||||||
import env from "../lib/env-vars";
|
import env from "../lib/env-vars";
|
||||||
import * as T from "../../../website/src/lib/account-types";
|
import * as T from "../../../website/src/lib/account-types";
|
||||||
|
import { getTimestamp } from "../lib/time-utils";
|
||||||
|
|
||||||
export const outsideProviders: ("github" | "google" | "twitter")[] = ["github", "google", "twitter"];
|
export const outsideProviders: ("github" | "google" | "twitter")[] = ["github", "google", "twitter"];
|
||||||
|
|
||||||
|
@ -150,7 +151,7 @@ function setupPassport(passport: PassportStatic) {
|
||||||
cb(null, false);
|
cb(null, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const newUser = await insertLingdocsUser(updateLastActive(user));
|
const newUser = await updateLingdocsUser(userId, { lastActive: getTimestamp() });
|
||||||
cb(null, newUser);
|
cb(null, newUser);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
cb(err, null);
|
cb(err, null);
|
||||||
|
|
Loading…
Reference in New Issue