@@ -56,7 +56,7 @@ class EncryptedHandler extends DefaultPrismaProxyHandler {
5656
5757 private async encrypt ( field : FieldInfo , data : string ) : Promise < string > {
5858 if ( this . isCustomEncryption ( this . options . encryption ! ) ) {
59- return this . options . encryption . encrypt ( this . model , field , data ) ;
59+ return await this . options . encryption . encrypt ( this . model , field , data ) ;
6060 }
6161
6262 const key = await getKey ( this . options . encryption ! . encryptionKey ) ;
@@ -80,7 +80,7 @@ class EncryptedHandler extends DefaultPrismaProxyHandler {
8080
8181 private async decrypt ( field : FieldInfo , data : string ) : Promise < string > {
8282 if ( this . isCustomEncryption ( this . options . encryption ! ) ) {
83- return this . options . encryption . decrypt ( this . model , field , data ) ;
83+ return await this . options . encryption . decrypt ( this . model , field , data ) ;
8484 }
8585
8686 const key = await getKey ( this . options . encryption ! . encryptionKey ) ;
@@ -145,10 +145,6 @@ class EncryptedHandler extends DefaultPrismaProxyHandler {
145145 field : async ( field , _action , data , context ) => {
146146 const encAttr = field . attributes ?. find ( ( attr ) => attr . name === '@encrypted' ) ;
147147 if ( encAttr && field . type === 'String' ) {
148- // encrypt value
149-
150- const secret : string = encAttr . args . find ( ( arg ) => arg . name === 'secret' ) ?. value as string ;
151-
152148 context . parent [ field . name ] = await this . encrypt ( field , data ) ;
153149 }
154150 } ,
0 commit comments