diff --git a/integration/ocean/AuthenticationToken.test.ts b/integration/ocean/AuthenticationToken.test.ts index 5cc6e9f..dfd4be8 100644 --- a/integration/ocean/AuthenticationToken.test.ts +++ b/integration/ocean/AuthenticationToken.test.ts @@ -68,7 +68,7 @@ describe("Authentication Token", () => { assert.isFalse(acc2Stored) assert.isFalse(await account2.isTokenStored()) - await ocean.auth.store(account2) + await account2.authenticate() acc2Stored = await ocean.auth.isStored(account2) assert.isTrue(acc2Stored) diff --git a/integration/ocean/ConsumeAssetBrizo.test.ts b/integration/ocean/ConsumeAssetBrizo.test.ts index 7ea7379..493d395 100644 --- a/integration/ocean/ConsumeAssetBrizo.test.ts +++ b/integration/ocean/ConsumeAssetBrizo.test.ts @@ -25,6 +25,17 @@ describe("Consume Asset (Brizo)", () => { consumer = (await ocean.accounts.list())[1] }) + after(() => { + try { + localStorage.clear() + } catch { } + }) + + it("should authenticate the accounts", async () => { + await publisher.authenticate() + await consumer.authenticate() + }) + it("should regiester an asset", async () => { const steps = [] ddo = await ocean.assets.create(metadata as any, publisher) diff --git a/src/ocean/Account.ts b/src/ocean/Account.ts index 398b832..3657f7c 100644 --- a/src/ocean/Account.ts +++ b/src/ocean/Account.ts @@ -65,6 +65,13 @@ export default class Account extends Instantiable { return this.ocean.auth.isStored(this) } + /** + * Authenticate the account. + */ + public authenticate() { + return this.ocean.auth.store(this) + } + /** * Balance of Ocean Token. * @return {Promise}