Skip to content

Commit

Permalink
Validate JWT Token issuer when validating.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisl8 committed Dec 14, 2023
1 parent 5a09a42 commit 5458a7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion network_websocket.gd
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func generate_jwt(secret: String, player_uuid: String) -> String:
func validate_and_decode_jwt(secret: String, jwt: String) -> Dictionary:
var content: Dictionary = {}
var jwt_algorithm: JWTAlgorithm = JWTAlgorithm.HS256.new(secret)
var jwt_verifier: JWTVerifier = JWT.require(jwt_algorithm).build() # Reusable Verifier
var jwt_verifier: JWTVerifier = JWT.require(jwt_algorithm).with_issuer("Space Game").build()
if jwt_verifier.verify(jwt) == JWTVerifier.JWTExceptions.OK:
var jwt_decoder: JWTDecoder = JWT.decode(jwt)
content = jwt_decoder.get_claims()
Expand Down

0 comments on commit 5458a7d

Please sign in to comment.