feat: 支持一键发布服务端
This commit is contained in:
@@ -36,7 +36,7 @@ export class AuthController {
|
||||
@Body() bindPhoneDto: BindPhoneDto,
|
||||
): Promise<User> {
|
||||
return this.authService.bindPhone(
|
||||
req.user.userId,
|
||||
req.user.sub,
|
||||
bindPhoneDto.encryptedData,
|
||||
bindPhoneDto.iv,
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@ import { UserRole } from '@mp-pilates/shared'
|
||||
import { JwtPayload } from './auth.service'
|
||||
|
||||
export interface AuthenticatedUser {
|
||||
userId: string
|
||||
sub: string
|
||||
role: UserRole
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
|
||||
})
|
||||
}
|
||||
|
||||
validate(payload: JwtPayload): AuthenticatedUser {
|
||||
validate(payload: JwtPayload): { sub: string; role: UserRole } {
|
||||
return {
|
||||
userId: payload.sub,
|
||||
sub: payload.sub,
|
||||
role: payload.role,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user