Skip to content

Commit b78338b

Browse files
committed
refactor: remove register endpoint and update magic link login summary for user creation
1 parent 541ba14 commit b78338b

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

server/src/auth/auth.controller.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,10 @@ export class AuthController {
2828
private readonly magicLinkEmailStrategy: MagicLinkEmailStrategy,
2929
) {}
3030

31-
@Post('register')
32-
@ApiOperation({
33-
summary: 'Register user and send a email with a single use login link',
34-
})
35-
public async register(@Body() registerDto: NewEmailUserDto) {
36-
return this.authService.register(registerDto);
37-
}
38-
3931
@Post('login/magic-link')
4032
@ApiOperation({
41-
summary: 'Will send the user a email with a single use login link',
33+
summary:
34+
'Will send the user a email with a single use login link, if the user does not exist it will create a new user',
4235
requestBody: {
4336
content: {
4437
'application/json': {

server/src/auth/auth.service.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { GithubAccessToken, GithubEmailList } from './types/githubProfile';
1919
import { GoogleProfile } from './types/googleProfile';
2020
import { Profile } from './types/profile';
2121
import { TokenPayload, Tokens } from './types/token';
22-
import { MagicLinkEmailStrategy } from './strategies/magicLinkEmail.strategy';
2322

2423
@Injectable()
2524
export class AuthService {
@@ -263,14 +262,6 @@ export class AuthService {
263262
return user;
264263
}
265264

266-
public async register(registerDto: NewEmailUserDto) {
267-
await this.userService.createWithEmail(registerDto);
268-
269-
return {
270-
message: 'User created',
271-
};
272-
}
273-
274265
public async validateEmail(body: Record<string, string | undefined>) {
275266
// get destination from body
276267
const { destination } = body;

0 commit comments

Comments
 (0)