Skip to content

Commit e7540fb

Browse files
Don't delete channel until it's used
1 parent 4d4b01e commit e7540fb

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

packages/apollo-collaboration-server/src/authentication/authentication.service.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ export class AuthenticationService {
186186
username: name,
187187
role: newUserRole,
188188
}
189+
this.logger.log(
190+
`First time login for "${newUser.username}" (${newUser.email})`,
191+
)
189192
user = await this.usersService.addNew(newUser)
190193
}
191194
this.logger.debug(`User found in Mongo: ${JSON.stringify(user)}`)
@@ -198,11 +201,7 @@ export class AuthenticationService {
198201
}
199202
// Return token with SUCCESS status
200203
const returnToken = this.jwtService.sign(payload)
201-
this.logger.debug(
202-
`First time login successful. Apollo token: ${JSON.stringify(
203-
returnToken,
204-
)}`,
205-
)
204+
this.logger.debug(`User "${user.username}" has logged in`)
206205
return { token: returnToken }
207206
}
208207
}

packages/jbrowse-plugin-apollo/src/ApolloInternetAccount/model.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
107107
if (
108108
event.data.name !== `JBrowseAuthWindow-${self.internetAccountId}`
109109
) {
110-
this.deleteMessageChannel()
111110
return
112111
}
113112
const redirectUriWithInfo = event.data.redirectUri

packages/jbrowse-plugin-apollo/src/session/session.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,10 @@ export function extendSession(
345345
console.error(error)
346346
continue
347347
}
348+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
349+
if (!jbrowseConfig.configuration.ApolloPlugin.hasRole) {
350+
continue
351+
}
348352
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
349353
reloadPluginManagerCallback(
350354
jbrowseConfig,

0 commit comments

Comments
 (0)