File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @codrjs/core" ,
3- "version" : " 1.0.4" ,
3+ "version" : " 1.0.4-patch1 " ,
44 "description" : " An open-sourced customizable annotation tool" ,
55 "main" : " index.js" ,
66 "repository" : " git@github.com:CodrJS/Core.git" ,
Original file line number Diff line number Diff line change @@ -46,9 +46,16 @@ class Authentication {
4646 let secretKey = md5 ( process . env . SECRET as string ) ;
4747 secretKey = Buffer . concat ( [ secretKey , secretKey . subarray ( 0 , 8 ) ] ) ;
4848 const decipher = crypto . createDecipheriv ( "des-ede3" , secretKey , "" ) ;
49- let decrypted = decipher . update ( text , "utf8" , "hex" ) ;
49+ let decrypted = decipher . update ( text , "hex" ) ;
50+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
51+ // @ts -ignore
5052 decrypted += decipher . final ( ) ;
51- return decrypted ;
53+ return decrypted as unknown as string ;
54+ }
55+
56+ generateCode ( payload : Record < string , any > ) {
57+ const data = JSON . stringify ( payload ) ;
58+ return this . encrypt ( data ) ;
5259 }
5360
5461 async signinWithEmail (
@@ -91,7 +98,7 @@ class Authentication {
9198 ) ,
9299 } ) ;
93100
94- // send email with magic link
101+ // send email with access code/token
95102 const link =
96103 process . env [ "DOMAIN" ] +
97104 "/auth/email/verify?token=" +
You can’t perform that action at this time.
0 commit comments