fix(xo-server): better token check on HTTP request
It now checks that the user associated with the authentication token really exists. This fixes xo-web infinite refresh when the token stored in cookies belongs to a missing user.
This commit is contained in:
parent
04d70e9aa8
commit
ef2bd2b59d
@ -42,6 +42,7 @@
|
||||
- @xen-orchestra/fs patch
|
||||
- @vates/node-vsphere-soap major
|
||||
- @xen-orchestra/vmware-explorer patch
|
||||
- xo-server patch
|
||||
- xo-server-auth-oidc minor
|
||||
- xo-web minor
|
||||
|
||||
|
@ -267,7 +267,8 @@ export default class {
|
||||
}
|
||||
|
||||
async isValidAuthenticationToken(id) {
|
||||
return (await this._getAuthenticationToken(id)) !== undefined
|
||||
const token = await this._getAuthenticationToken(id)
|
||||
return token !== undefined && (await this._app.doesUserExist(token.user_id))
|
||||
}
|
||||
|
||||
async updateAuthenticationToken(properties, { description }) {
|
||||
|
@ -119,6 +119,10 @@ export default class {
|
||||
})
|
||||
}
|
||||
|
||||
doesUserExist(id) {
|
||||
return this._users.exists(id)
|
||||
}
|
||||
|
||||
async updateUser(
|
||||
id,
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user