(self)
| 140 | self.fittings_deleted.add(fittingID) |
| 141 | |
| 142 | def login(self): |
| 143 | start_server = self.settings.get('loginMode') == EsiLoginMethod.SERVER and self.server_base.supports_auto_login |
| 144 | with gui.ssoLogin.SsoLogin(self.server_base, start_server) as dlg: |
| 145 | if dlg.ShowModal() == wx.ID_OK: |
| 146 | from gui.esiFittings import ESIExceptionHandler |
| 147 | |
| 148 | try: |
| 149 | if self.server_name == "Serenity": |
| 150 | s = re.search(r'(?<=code=)[a-zA-Z0-9\-_]*', dlg.ssoInfoCtrl.Value.strip()) |
| 151 | if s: |
| 152 | # skip state verification and go directly through the auth code processing |
| 153 | self.handleLogin(s.group(0)) |
| 154 | else: |
| 155 | pass |
| 156 | # todo: throw error |
| 157 | else: |
| 158 | self.handleServerRequest(json.loads(base64.b64decode(dlg.ssoInfoCtrl.Value.strip()))) |
| 159 | except GenericSsoError as ex: |
| 160 | pyfalog.error(ex) |
| 161 | with wx.MessageDialog( |
| 162 | self.mainFrame, |
| 163 | str(ex), |
| 164 | _t("SSO Error"), |
| 165 | wx.OK | wx.ICON_ERROR |
| 166 | ) as dlg: |
| 167 | dlg.ShowModal() |
| 168 | except APIException as ex: |
| 169 | pyfalog.error(ex) |
| 170 | ESIExceptionHandler(ex) |
| 171 | pass |
| 172 | |
| 173 | |
| 174 | def stopServer(self): |
no test coverage detected