File tree Expand file tree Collapse file tree
test/integration/cloud/cloud Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ export const cloudTemplateController: FastifyPluginAsyncTypebox = async (
5151 async ( request ) => {
5252 const user = getVerifiedUser ( request , publicKey ) ;
5353 if ( ! user ) {
54- logger . info ( 'User is not authenticated, returning sample templates' ) ;
5554 return flowTemplateService . getFlowTemplates ( {
5655 search : request . query . search ,
5756 tags : request . query . tags ,
@@ -67,7 +66,6 @@ export const cloudTemplateController: FastifyPluginAsyncTypebox = async (
6766 } ) ;
6867 }
6968
70- logger . info ( 'User is authenticated, returning all templates' ) ;
7169 return flowTemplateService . getFlowTemplates ( {
7270 search : request . query . search ,
7371 tags : request . query . tags ,
Original file line number Diff line number Diff line change @@ -63,7 +63,9 @@ describe('getVerifiedUser', () => {
6363
6464 const result = getVerifiedUser ( mockRequest , publicKey ) ;
6565
66- expect ( jwt . verify ) . toHaveBeenCalledWith ( 'header-token' , publicKey ) ;
66+ expect ( jwt . verify ) . toHaveBeenCalledWith ( 'header-token' , publicKey , {
67+ algorithms : [ 'RS256' ] ,
68+ } ) ;
6769 expect ( result ) . toEqual ( payload ) ;
6870 } ) ;
6971
@@ -77,7 +79,9 @@ describe('getVerifiedUser', () => {
7779
7880 const result = getVerifiedUser ( mockRequest , publicKey ) ;
7981
80- expect ( jwt . verify ) . toHaveBeenCalledWith ( 'cookie-token' , publicKey ) ;
82+ expect ( jwt . verify ) . toHaveBeenCalledWith ( 'cookie-token' , publicKey , {
83+ algorithms : [ 'RS256' ] ,
84+ } ) ;
8185 expect ( result ) . toEqual ( payload ) ;
8286 } ) ;
8387
@@ -93,6 +97,8 @@ describe('getVerifiedUser', () => {
9397 const result = getVerifiedUser ( mockRequest , publicKey ) ;
9498
9599 expect ( result ) . toBeUndefined ( ) ;
96- expect ( jwt . verify ) . toHaveBeenCalledWith ( 'bad-token' , publicKey ) ;
100+ expect ( jwt . verify ) . toHaveBeenCalledWith ( 'bad-token' , publicKey , {
101+ algorithms : [ 'RS256' ] ,
102+ } ) ;
97103 } ) ;
98104} ) ;
You can’t perform that action at this time.
0 commit comments