forked from timothymiller/t4-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
2,637 additions
and
765 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
APP_URL=http://localhost:3000 | ||
JWT_VERIFICATION_KEY= | ||
DATABASE_ID= | ||
DATABASE_ID= | ||
|
||
GOOGLE_CLIENT_ID= | ||
GOOGLE_CLIENT_SECRET= | ||
APPLE_CLIENT_ID= | ||
APPLE_TEAM_ID= | ||
APPLE_KEY_ID= | ||
APPLE_CERTIFICATE= | ||
DISCORD_CLIENT_ID= | ||
DISCORD_CLIENT_SECRET= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/// <reference types="lucia" /> | ||
|
||
type DBAttributes = { | ||
// Note, these need to match the database column names, | ||
// so they might need to be snake_case instead of camelCase, for example | ||
// Adjust userToAuthUserAttributes in @t4/api/src/auth to match | ||
email: string | null | ||
} | ||
|
||
declare namespace Lucia { | ||
type Auth = import('./src/auth/shared').Auth | ||
type DatabaseUserAttributes = DBAttributes | ||
type DatabaseSessionAttributes = {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
CREATE TABLE `Session` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`user_id` text NOT NULL, | ||
`active_expires` integer NOT NULL, | ||
`idle_expires` integer NOT NULL, | ||
FOREIGN KEY (`user_id`) REFERENCES `User`(`id`) ON UPDATE no action ON DELETE no action | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE `UserKey` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`user_id` text NOT NULL, | ||
`hashed_password` text, | ||
`created_at` text DEFAULT CURRENT_TIMESTAMP, | ||
FOREIGN KEY (`user_id`) REFERENCES `User`(`id`) ON UPDATE no action ON DELETE no action | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE `VerificationCode` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`user_id` text NOT NULL, | ||
`code` text NOT NULL, | ||
`expires` integer NOT NULL, | ||
`timeout_until` integer, | ||
`timeout_seconds` integer DEFAULT 0 NOT NULL, | ||
FOREIGN KEY (`user_id`) REFERENCES `User`(`id`) ON UPDATE no action ON DELETE no action | ||
); | ||
--> statement-breakpoint | ||
CREATE INDEX `idx_session_userId` ON `Session` (`user_id`);--> statement-breakpoint | ||
CREATE INDEX `idx_userKey_userId` ON `UserKey` (`user_id`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `VerificationCode_user_id_unique` ON `VerificationCode` (`user_id`);--> statement-breakpoint | ||
CREATE INDEX `idx_verificationCode_userId` ON `VerificationCode` (`user_id`); |
Oops, something went wrong.