-
Notifications
You must be signed in to change notification settings - Fork 5
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
112 changed files
with
1,668 additions
and
1,453 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
import { schema, Query } from "./schema.gen.ts"; | ||
import { Query, schema } from "./schema.gen.ts"; | ||
|
||
export const verifications = schema.table('verifications', { | ||
id: Query.uuid("id").primaryKey().defaultRandom(), | ||
export const verifications = schema.table("verifications", { | ||
id: Query.uuid("id").primaryKey().defaultRandom(), | ||
|
||
email: Query.text("email").notNull(), | ||
email: Query.text("email").notNull(), | ||
|
||
code: Query.text("code").notNull().unique(), | ||
token: Query.text("token").notNull().unique(), | ||
code: Query.text("code").notNull().unique(), | ||
token: Query.text("token").notNull().unique(), | ||
|
||
attemptCount: Query.integer("attempt_count").notNull().default(0), | ||
maxAttemptCount: Query.integer("max_attempt_count").notNull(), | ||
attemptCount: Query.integer("attempt_count").notNull().default(0), | ||
maxAttemptCount: Query.integer("max_attempt_count").notNull(), | ||
|
||
createdAt: Query.timestamp("created_at").notNull().defaultNow(), | ||
expireAt: Query.timestamp("expire_at").notNull(), | ||
completedAt: Query.timestamp("completed_at"), | ||
createdAt: Query.timestamp("created_at").notNull().defaultNow(), | ||
expireAt: Query.timestamp("expire_at").notNull(), | ||
completedAt: Query.timestamp("completed_at"), | ||
}); | ||
|
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
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,14 +1,16 @@ | ||
import { RuntimeError, ScriptContext } from "../module.gen.ts"; | ||
import { ReqOf, ResOf } from "../utils/types.ts"; | ||
|
||
|
||
export type Request = ReqOf<ScriptContext["modules"]["authEmail"]["verifyLinkEmail"]>; | ||
export type Response = ResOf<ScriptContext["modules"]["authEmail"]["verifyLinkEmail"]>; | ||
export type Request = ReqOf< | ||
ScriptContext["modules"]["authEmail"]["verifyLinkEmail"] | ||
>; | ||
export type Response = ResOf< | ||
ScriptContext["modules"]["authEmail"]["verifyLinkEmail"] | ||
>; | ||
|
||
export async function run( | ||
ctx: ScriptContext, | ||
req: Request, | ||
): Promise<Response> { | ||
return await ctx.modules.authEmail.verifyLinkEmail(req); | ||
} | ||
|
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,2 +1,4 @@ | ||
export type ReqOf<T> = T extends (req: infer Req) => Promise<infer Res> ? Req : never; | ||
export type ResOf<T> = T extends (req: infer Req) => Promise<infer Res> ? Res : never; | ||
export type ReqOf<T> = T extends (req: infer Req) => Promise<infer Res> ? Req | ||
: never; | ||
export type ResOf<T> = T extends (req: infer Req) => Promise<infer Res> ? Res | ||
: never; |
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,14 +1,16 @@ | ||
import { RuntimeError, ScriptContext } from "../module.gen.ts"; | ||
import { ReqOf, ResOf } from "../utils/types.ts"; | ||
|
||
|
||
export type Request = ReqOf<ScriptContext["modules"]["authEmail"]["signInEmailPass"]>; | ||
export type Response = ResOf<ScriptContext["modules"]["authEmail"]["signInEmailPass"]>; | ||
export type Request = ReqOf< | ||
ScriptContext["modules"]["authEmail"]["signInEmailPass"] | ||
>; | ||
export type Response = ResOf< | ||
ScriptContext["modules"]["authEmail"]["signInEmailPass"] | ||
>; | ||
|
||
export async function run( | ||
ctx: ScriptContext, | ||
req: Request, | ||
): Promise<Response> { | ||
return await ctx.modules.authEmail.signInEmailPass(req); | ||
} | ||
|
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
9 changes: 6 additions & 3 deletions
9
modules/auth_email_password/scripts/verify_sign_up_email_pass.ts
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,2 +1,4 @@ | ||
export type ReqOf<T> = T extends (req: infer Req) => Promise<infer Res> ? Req : never; | ||
export type ResOf<T> = T extends (req: infer Req) => Promise<infer Res> ? Res : never; | ||
export type ReqOf<T> = T extends (req: infer Req) => Promise<infer Res> ? Req | ||
: never; | ||
export type ResOf<T> = T extends (req: infer Req) => Promise<infer Res> ? Res | ||
: never; |
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
9 changes: 6 additions & 3 deletions
9
modules/auth_email_passwordless/scripts/verify_add_no_pass.ts
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
10 changes: 6 additions & 4 deletions
10
modules/auth_email_passwordless/scripts/verify_login_or_create_no_pass.ts
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,14 +1,16 @@ | ||
import { RuntimeError, ScriptContext } from "../module.gen.ts"; | ||
import { ReqOf, ResOf } from "../utils/types.ts"; | ||
|
||
|
||
export type Request = ReqOf<ScriptContext["modules"]["authEmail"]["verifyLoginOrCreateNoPass"]>; | ||
export type Response = ResOf<ScriptContext["modules"]["authEmail"]["verifyLoginOrCreateNoPass"]>; | ||
export type Request = ReqOf< | ||
ScriptContext["modules"]["authEmail"]["verifyLoginOrCreateNoPass"] | ||
>; | ||
export type Response = ResOf< | ||
ScriptContext["modules"]["authEmail"]["verifyLoginOrCreateNoPass"] | ||
>; | ||
|
||
export async function run( | ||
ctx: ScriptContext, | ||
req: Request, | ||
): Promise<Response> { | ||
return await ctx.modules.authEmail.verifyLoginOrCreateNoPass(req); | ||
} | ||
|
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,2 +1,4 @@ | ||
export type ReqOf<T> = T extends (req: infer Req) => Promise<infer Res> ? Req : never; | ||
export type ResOf<T> = T extends (req: infer Req) => Promise<infer Res> ? Res : never; | ||
export type ReqOf<T> = T extends (req: infer Req) => Promise<infer Res> ? Req | ||
: never; | ||
export type ResOf<T> = T extends (req: infer Req) => Promise<infer Res> ? Res | ||
: never; |
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
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
Oops, something went wrong.