Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
infomiho committed Jul 30, 2024
1 parent 69de38b commit a12863b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion waspc/data/Generator/templates/sdk/wasp/server/auth/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,12 @@ type OnAfterLoginHookParams = {
*/
uniqueRequestId: string
},
/**
* User that is logged in.
*/
user: Awaited<ReturnType<typeof findAuthWithUserBy>>['user']
/**
* Request object that can be used to access the incoming request.
*/
req: ExpressRequest
} & InternalAuthHookParams
} & InternalAuthHookParams
8 changes: 4 additions & 4 deletions waspc/examples/todoApp/src/auth/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ export const onBeforeLogin: OnBeforeLoginHook = async (args) => {
const log = createLoggerForHook('onBeforeLogin')
log('providerId object', args.providerId)

const now = new Date()
if (now.getHours() < 14) {
throw new HttpError(403, 'Login is only possible after 2 PM')
}
// const now = new Date()
// if (now.getHours() < 14) {
// throw new HttpError(403, 'Login is only possible after 2 PM')
// }
}

export const onAfterLogin: OnAfterLoginHook = async (args) => {
Expand Down

0 comments on commit a12863b

Please sign in to comment.