mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
fix types issue
This commit is contained in:
1 parent
807974d727
commit
c4fd92e289
2 files changed
+5
-2
No files matched your search
@@ -1,7 +1,10 @@
|
||||
import type { Request, Response, NextFunction } from 'express'
|
||||
import logger from '../utils/logger.js'
|
||||
|
||||
export function asyncHandler(fn: any) {
|
||||
export function asyncHandler(
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
fn: (req: Request, res: Response, next: NextFunction) => Promise<void>
|
||||
) {
|
||||
return (req: Request, res: Response, next: NextFunction) => {
|
||||
fn(req, res, next).catch(next)
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ export function hashPassword(password: string): Promise<string> {
|
||||
return bcrypt.hash(password, 10)
|
||||
}
|
||||
|
||||
export function genJWT(payload: any): Promise<string> {
|
||||
export function genJWT(payload: { [key: string]: string }): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
jwt.sign(
|
||||
payload,
|
||||
|
||||
Reference in new issue
Block a user