mirror of
https://github.com/desktop/desktop
synced 2024-10-31 05:19:03 +00:00
Any object containing similar keys is not the same as the thing we want.
This commit is contained in:
parent
c9e4b1b629
commit
ccaf0aa41f
2 changed files with 5 additions and 5 deletions
|
@ -49,9 +49,9 @@ export function askUserToAuth(endpoint: string) {
|
|||
shell.openExternal(getOAuthURL(authState))
|
||||
}
|
||||
|
||||
export function getToken(user: User): string {
|
||||
const serviceName = getServiceNameForUser(user)
|
||||
return keytar.getPassword(serviceName, user.getLogin())
|
||||
export function getToken(login: string, endpoint: string): string {
|
||||
const serviceName = getServiceNameForUser(new User(login, endpoint, ''))
|
||||
return keytar.getPassword(serviceName, login)
|
||||
}
|
||||
|
||||
export function setToken(user: User, token: string) {
|
||||
|
|
|
@ -46,8 +46,8 @@ export default class UsersStore {
|
|||
return
|
||||
}
|
||||
|
||||
const rawUsers: User[] = JSON.parse(raw)
|
||||
const usersWithTokens = rawUsers.map(user => user.userWithToken(getToken(user)))
|
||||
const rawUsers: any[] = JSON.parse(raw)
|
||||
const usersWithTokens = rawUsers.map(user => new User(user.login, user.endpoint, getToken(user.login, user.endpoint)))
|
||||
this.users = usersWithTokens
|
||||
|
||||
this.usersDidChange()
|
||||
|
|
Loading…
Reference in a new issue