Skip to content

Commit

Permalink
fix: add condition for token to authenticate user (#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
afzal442 authored Oct 10, 2023
1 parent 2a0b56a commit 59041da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/crypto-websockets/server/auth/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export async function serverAuth({ authProps, done }) {
console.log("token", authProps.getToken())
console.log("userpass", authProps.getUserPass())

done(false)
if (authProps.getToken().split(' ')[1] === process.env.TOKEN) {
done(true);
} else {
done(false);
}
}

export async function clientAuth({ parsedAsyncAPI, serverName }) {
Expand Down

0 comments on commit 59041da

Please sign in to comment.