File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,13 @@ totpAuthenticator.use(
23
23
},
24
24
async (data ) => {
25
25
const { event, request } = data ;
26
+ // this part is a example, dev can use a cookie to store the code and email to validate user magic link
27
+ // or store in a database to validate user magic link.
28
+ // there is 2 events, send-email and verify-code.
29
+ // send-email is used to send the email to the user with the code and magic link.
30
+ // verify-code is used to verify the code and email with the logic you prefer.
26
31
if (event === " send-email" ) {
32
+ // send-email event
27
33
const { email, code } = data ;
28
34
console .log (` \x1b [35m[DEV ONLY]:\x1b [0m \x1b [42m${code }\x1b [0m` );
29
35
@@ -46,11 +52,11 @@ totpAuthenticator.use(
46
52
});
47
53
}
48
54
55
+ // verify-code event
49
56
return {
50
57
id: " 1" ,
51
58
email: " " ,
52
59
};
53
- // TODO: validate data
54
60
},
55
61
),
56
62
" totp" ,
You can’t perform that action at this time.
0 commit comments