File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,8 @@ import type { AuthModel } from './model'
87
87
88
88
// If the class doesn't need to store a property,
89
89
// you may use `abstract class` to avoid class allocation
90
- abstract class Auth {
91
- static async signIn({ username , password }: AuthModel .SignIn ) {
90
+ export abstract class Auth {
91
+ static async signIn({ username , password }: AuthModel .signInBody ) {
92
92
const user = await sql `
93
93
SELECT password
94
94
FROM users
@@ -99,7 +99,7 @@ abstract class Auth {
99
99
// You can throw an HTTP error directly
100
100
throw status (
101
101
400 ,
102
- ' Invalid username or password' satisfies AuthModel .SignInInvalid
102
+ ' Invalid username or password' satisfies AuthModel .signInInvalid
103
103
)
104
104
105
105
return {
@@ -122,15 +122,15 @@ export namespace AuthModel {
122
122
})
123
123
124
124
// Define it as TypeScript type
125
- export type signInBody = typeof signIn .static
125
+ export type signInBody = typeof signInBody .static
126
126
127
127
// Repeat for other models
128
128
export const signInResponse = t .Object ({
129
129
username: t .String (),
130
130
token: t .String (),
131
131
})
132
132
133
- export type signInResponse = typeof signIn .static
133
+ export type signInResponse = typeof signInResponse .static
134
134
135
135
export const signInInvalid = t .Literal (' Invalid username or password' )
136
136
export type signInInvalid = typeof signInInvalid .static
You can’t perform that action at this time.
0 commit comments