Skip to content
This repository has been archived by the owner on Dec 26, 2017. It is now read-only.

Commit

Permalink
Make auth_info check more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
trisk committed Sep 6, 2016
1 parent 64496d8 commit b1bdf4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/pokemon-go-mitm.coffee
Expand Up @@ -65,7 +65,7 @@ class PokemonGoMITM
if req.auth_ticket
@expiration = parseInt req.auth_ticket.expire_timestamp_ms
Buffer.concat([req.auth_ticket.start, req.auth_ticket.end]).toString()
else if req.auth_info
else if req.auth_info and req.auth_info.token
req.auth_info.token.contents

setResponse: (res) ->
Expand Down Expand Up @@ -390,7 +390,7 @@ class PokemonGoMITM
id = if req.auth_ticket
Buffer.concat [req.auth_ticket.start, req.auth_ticket.end]
.toString()
else if req.auth_info
else if req.auth_info and req.auth_info.token
req.auth_info.token.contents

unless id and session = @sessions[id]
Expand Down Expand Up @@ -545,6 +545,6 @@ class PokemonGoMITM
log: ->
for arg, i in arguments when typeof arg is 'object'
arguments[i] = util.inspect arg, { depth: null }
console.log.apply(null, arguments) if @debug
console.log.apply null, arguments if @debug

module.exports = PokemonGoMITM

0 comments on commit b1bdf4d

Please sign in to comment.