Skip to content

Commit

Permalink
chore: sms login and fix githubLogin related field
Browse files Browse the repository at this point in the history
  • Loading branch information
dvlin-dev committed Jul 9, 2023
1 parent 2085c2f commit 6fa0a4f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/entity/profile.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,19 @@ export class Profile {
@Column({ nullable: true })
photo: string;

@Column()
@Column({ nullable: true })
@Expose()
address: string;

@Column()
@Column({ nullable: true })
@Expose()
description: string;

// github

@Column()
@Column({ nullable: true })
@Expose()
githubLogin: string;

@Column()
@Column({ nullable: true })
@Expose()
githubName: string;

Expand Down
6 changes: 5 additions & 1 deletion src/modules/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ export class AuthController {
@ApiOperation({ summary: '邮箱&验证码 登录' })
@Post('/signin_by_code')
async signInByEmailAndcode(@Body() dto: SignInByEmailAndCodeDto, @Req() req: Request) {
const { accessToken, refreshToken } = await this.authService.signInByEmailAndCode(dto, req);
const { user, accessToken, refreshToken } = await this.authService.signInByEmailAndCode(
dto,
req,
);
return {
user,
accessToken,
refreshToken,
};
Expand Down
1 change: 1 addition & 0 deletions src/modules/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export class AuthService {
await this.storeAccessTokenInRedis(user.id, deviceId, accessToken);

return {
user,
accessToken,
refreshToken,
};
Expand Down

0 comments on commit 6fa0a4f

Please sign in to comment.