chore(webui): unset nonce when logging out (#2242)
Reviewed-on: #2242 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									d16d763977
								
							
						
					
					
						commit
						3bcd5827f9
					
				@ -176,7 +176,17 @@ const wsOnConnect = (ws: ws, _req: http.IncomingMessage): void => {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (data.logout) {
 | 
					        if (data.logout) {
 | 
				
			||||||
 | 
					            const accountId = (ws as IWsCustomData).accountId;
 | 
				
			||||||
            (ws as IWsCustomData).accountId = undefined;
 | 
					            (ws as IWsCustomData).accountId = undefined;
 | 
				
			||||||
 | 
					            await Account.updateOne(
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    _id: accountId,
 | 
				
			||||||
 | 
					                    ClientType: "webui"
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    Nonce: 0
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user