diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-08-24 14:23:44 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-08-24 14:23:44 +0200 |
| commit | 0fc710e14894910e81ba957ef04082937a7ee5d3 (patch) | |
| tree | 49adac5ae801493e8e25f3882b936017edc9134e | |
| parent | adc86a0de57367d0243a4f7dc08c87840f421b39 (diff) | |
| download | mullvadvpn-0fc710e14894910e81ba957ef04082937a7ee5d3.tar.xz mullvadvpn-0fc710e14894910e81ba957ef04082937a7ee5d3.zip | |
Rename paid_until to expiry
| -rw-r--r-- | app/lib/backend.js | 4 | ||||
| -rw-r--r-- | app/lib/ipc-facade.js | 6 | ||||
| -rw-r--r-- | test/autologin.spec.js | 4 | ||||
| -rw-r--r-- | test/login.spec.js | 2 | ||||
| -rw-r--r-- | test/logout.spec.js | 2 | ||||
| -rw-r--r-- | test/mocks/ipc.js | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js index 6d5c4ebd14..ee11feee9d 100644 --- a/app/lib/backend.js +++ b/app/lib/backend.js @@ -163,7 +163,7 @@ export class Backend { }).then( accountData => { log.info('Log in complete'); - this._store.dispatch(accountActions.loginSuccessful(accountData.paid_until)); + this._store.dispatch(accountActions.loginSuccessful(accountData.expiry)); // Redirect the user after some time to allow for // the 'Login Successful' screen to be visible @@ -197,7 +197,7 @@ export class Backend { .then( accountData => { log.info('The stored account number still exists', accountData); - this._store.dispatch(accountActions.loginSuccessful(accountData.paid_until)); + this._store.dispatch(accountActions.loginSuccessful(accountData.expiry)); this._store.dispatch(push('/connect')); }) diff --git a/app/lib/ipc-facade.js b/app/lib/ipc-facade.js index 2620f7958c..798b4d2805 100644 --- a/app/lib/ipc-facade.js +++ b/app/lib/ipc-facade.js @@ -6,7 +6,7 @@ import { validate } from 'validated/object'; import type { Coordinate2d } from '../types'; -export type AccountData = {paid_until: string}; +export type AccountData = {expiry: string}; export type AccountNumber = string; export type Ip = string; export type Location = { @@ -55,10 +55,10 @@ export class RealIpc implements IpcFacade { getAccountData(accountNumber: AccountNumber): Promise<AccountData> { return this._ipc.send('get_account_data', accountNumber) .then(raw => { - if (typeof raw === 'object' && raw && raw.paid_until) { + if (typeof raw === 'object' && raw && raw.expiry) { return raw; } else { - throw new InvalidReply(raw, 'Expected an object with paid_until'); + throw new InvalidReply(raw, 'Expected an object with expiry'); } }); } diff --git a/test/autologin.spec.js b/test/autologin.spec.js index 0c031b15ca..a0204b5070 100644 --- a/test/autologin.spec.js +++ b/test/autologin.spec.js @@ -84,7 +84,7 @@ describe('autologin', () => { const { store, backend, mockIpc } = setupBackendAndStore(); mockIpc.getAccount = () => new Promise(r => r('123')); mockIpc.getAccountData = () => new Promise(r => r({ - paid_until: '2001-01-01T00:00:00', + expiry: '2001-01-01T00:00:00Z', })); return backend.autologin() @@ -101,7 +101,7 @@ describe('autologin', () => { mockIpc.getAccount = () => new Promise(r => r('123')); mockIpc.getAccountData = () => new Promise(r => r({ - paid_until: '2001-01-01T00:00:00', + expiry: '2001-01-01T00:00:00Z', })); return backend.autologin() diff --git a/test/login.spec.js b/test/login.spec.js index 5c7e0fe540..88f1d1b9eb 100644 --- a/test/login.spec.js +++ b/test/login.spec.js @@ -31,7 +31,7 @@ describe('Logging in', () => { it('should put the account data in the state', () => { const { store, backend, mockIpc } = setupBackendAndStore(); mockIpc.getAccountData = () => new Promise(r => r({ - paid_until: '2001-01-01T00:00:00', + expiry: '2001-01-01T00:00:00Z', })); return backend.login('123') diff --git a/test/logout.spec.js b/test/logout.spec.js index f88df1bbc6..503c2e703a 100644 --- a/test/logout.spec.js +++ b/test/logout.spec.js @@ -28,7 +28,7 @@ describe('logging out', () => { const { store, backend, mockIpc } = setupBackendAndStore(); mockIpc.getAccountData = () => new Promise(r => r({ - paid_until: '2001-01-01T00:00:00', + expiry: '2001-01-01T00:00:00.000Z', })); const action: any = accountActions.login(backend, '123'); store.dispatch(action); diff --git a/test/mocks/ipc.js b/test/mocks/ipc.js index c182d45d21..3acdc2f76d 100644 --- a/test/mocks/ipc.js +++ b/test/mocks/ipc.js @@ -18,7 +18,7 @@ export function newMockIpc() { getAccountData: (accountNumber) => { return new Promise(r => r({ accountNumber: accountNumber, - paid_until: '', + expiry: '', })); }, getAccount: () => { |
