feat: add auth to tui
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
text,
|
||||
timestamp,
|
||||
uniqueIndex,
|
||||
integer,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { users } from "./public";
|
||||
|
||||
@@ -93,3 +94,19 @@ export const auditLogs = pgTable("audit_log", {
|
||||
action: text("action").notNull(),
|
||||
});
|
||||
|
||||
export const deviceCodes = pgTable("deviceCode", {
|
||||
id: text("id").primaryKey(),
|
||||
deviceCode: text("device_code").notNull(),
|
||||
userCode: text("user_code").notNull(),
|
||||
userId: text("user_id").references(() => users.id, {
|
||||
onDelete: "set null",
|
||||
}),
|
||||
clientId: text("client_id"),
|
||||
scope: text("scope"),
|
||||
status: text("status").notNull(),
|
||||
expiresAt: timestamp("expires_at"),
|
||||
lastPolledAt: timestamp("last_polled_at"),
|
||||
pollingInterval: integer("polling_interval"),
|
||||
createdAt: timestamp("created_at").notNull().defaultNow(),
|
||||
updatedAt: timestamp("updated_at").notNull().defaultNow(),
|
||||
});
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Transactions } from "./transactions";
|
||||
import { View, Text } from "react-native";
|
||||
import { Settings } from "./settings";
|
||||
import { useKeyboard } from "./useKeyboard";
|
||||
import type { AuthData } from "@money/shared/auth";
|
||||
|
||||
|
||||
const PAGES = {
|
||||
@@ -41,10 +42,8 @@ type Routes<T> = {
|
||||
|
||||
export type Route = Routes<typeof PAGES>;
|
||||
|
||||
type Auth = any;
|
||||
|
||||
interface RouterContextType {
|
||||
auth: Auth;
|
||||
auth: AuthData | null;
|
||||
route: Route;
|
||||
setRoute: (route: Route) => void;
|
||||
}
|
||||
@@ -58,7 +57,7 @@ export const RouterContext = createContext<RouterContextType>({
|
||||
|
||||
|
||||
type AppProps = {
|
||||
auth: Auth;
|
||||
auth: AuthData | null;
|
||||
route: Route;
|
||||
setRoute: (page: Route) => void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user