File tree Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ export class Auth0Service {
6565 async createVerificationEmailTicket (
6666 accessToken : string ,
6767 auth0UserId : string ,
68- ) : Promise < Auth0Response > {
68+ ) {
6969 try {
7070 const [ provider , userId ] = auth0UserId . split ( '|' ) ;
7171 const payload = {
@@ -77,7 +77,8 @@ export class Auth0Service {
7777 const options = {
7878 method : 'POST' ,
7979 headers : {
80- 'Authorization' : `Bearer ${ accessToken } ` ,
80+ /* tslint:disable-next-line */
81+ Authorization : `Bearer ${ accessToken } ` ,
8182 'content-type' : 'application/json' ,
8283 } ,
8384 body : JSON . stringify ( payload ) ,
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ export class UsersService {
1515
1616 async create ( userDto : UserDto ) : Promise < User > {
1717 const user = new this . userModel ( userDto ) ;
18- return await user . save ( ) ;
18+ const result = await user . save ( ) ;
19+ return result . toObject ( ) ;
1920 }
2021
2122 async findById ( _id : string ) : Promise < User > {
Original file line number Diff line number Diff line change @@ -20,9 +20,10 @@ interface WelcomePayload {
2020}
2121
2222interface VerificationEmailPayload {
23- name : 'verification- email' ;
23+ name : 'email-verification ' ;
2424 data : {
25- ticket : string ;
25+ name : string ;
26+ link : string ;
2627 } ;
2728}
2829
Original file line number Diff line number Diff line change @@ -406,10 +406,12 @@ export class UsersController {
406406 user . auth0Id ,
407407 ) ;
408408
409- // TODO - create email verification template
410409 this . emailService . sendLocalTemplate ( {
411- name : 'verification-email' ,
412- data : response ,
410+ name : 'email-verification' ,
411+ data : {
412+ name : user . name ,
413+ link : response . ticket ,
414+ } ,
413415 to : user . email ,
414416 subject : 'Verify your email' ,
415417 } ) ;
You can’t perform that action at this time.
0 commit comments