MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / handleLogin

Method handleLogin

service/esi.py:197–214  ·  view source on GitHub ↗
(self, code)

Source from the content-addressed store, hash-verified

195 return 'http://localhost:{}'.format(port)
196
197 def handleLogin(self, code):
198 auth_response, data = self.auth(code)
199
200 currentCharacter = self.getSsoCharacter(data['name'], self.server_base.name)
201
202 sub_split = data["sub"].split(":")
203
204 if len(sub_split) != 3:
205 raise GenericSsoError("JWT sub does not contain the expected data. Contents: %s" % data["sub"])
206
207 cid = sub_split[-1]
208 if currentCharacter is None:
209 currentCharacter = SsoCharacter(cid, data['name'], config.getClientSecret(), self.server_base.name)
210
211 Esi.update_token(currentCharacter, auth_response)
212
213 eos.db.save(currentCharacter)
214 wx.PostEvent(self.mainFrame, GE.SsoLogin(character=currentCharacter))
215
216 # get (endpoint, char, data?)
217

Callers 2

loginMethod · 0.95
handleServerRequestMethod · 0.95

Calls 6

getSsoCharacterMethod · 0.95
GenericSsoErrorClass · 0.90
SsoCharacterClass · 0.90
authMethod · 0.80
update_tokenMethod · 0.80
saveMethod · 0.80

Tested by

no test coverage detected