File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -53,9 +53,10 @@ export const handler = async (event: WebSocketEvent) => {
5353 const payload = await verifier . verify ( token ) ;
5454 console . log ( `Validated: ${ JSON . stringify ( payload ) } ` ) ;
5555 const { connectionId } = event . requestContext ;
56-
5756 const userId = payload . sub ;
5857
58+ console . log ( `About to store the following record: ${ JSON . stringify ( { connectionId, userId} ) } ` ) ;
59+
5960 await ddbDocClient . send (
6061 new PutCommand ( {
6162 TableName : process . env . ABSTRACT_PLAY_TABLE ! ,
@@ -72,16 +73,6 @@ export const handler = async (event: WebSocketEvent) => {
7273 } )
7374 ) ;
7475 } catch ( ex ) {
75- console . log ( "Connect error:" , JSON . stringify ( ex ) ) ;
76- const domain = event . requestContext . domainName ;
77- const stage = event . requestContext . stage ;
78- const connectionId = event . requestContext . connectionId ;
79-
80- const mgmt = new ApiGatewayManagementApiClient ( {
81- endpoint : `https://${ domain } /${ stage } ` ,
82- } ) ;
83-
84- await mgmt . send ( new DeleteConnectionCommand ( { ConnectionId : connectionId } ) ) ;
85- return { statusCode : 401 } ;
76+ console . log ( "Subscribe error:" , JSON . stringify ( ex ) ) ;
8677 }
8778} ;
You can’t perform that action at this time.
0 commit comments