CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/util/db-schema/auth.ts
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Table } from "./types";
7
8
Table({
9
name: "remember_me",
10
fields: {
11
hash: {
12
type: "string",
13
pg_type: "CHAR(127)",
14
},
15
value: {
16
type: "map",
17
},
18
account_id: {
19
type: "uuid",
20
},
21
expire: {
22
type: "timestamp",
23
},
24
},
25
rules: {
26
primary_key: "hash",
27
durability: "soft", // dropping this would just require a user to login again
28
pg_indexes: ["account_id"],
29
},
30
});
31
32
Table({
33
name: "auth_tokens",
34
fields: {
35
auth_token: {
36
type: "string",
37
pg_type: "CHAR(24)",
38
},
39
account_id: {
40
type: "uuid",
41
},
42
expire: {
43
type: "timestamp",
44
},
45
},
46
rules: {
47
primary_key: "auth_token",
48
},
49
});
50
51