Skip to content

Commit

Permalink
Clear URL after login through WalletAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrichina committed Oct 23, 2019
1 parent 8f5063b commit 385b79c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dist/nearlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -1690,6 +1690,9 @@ class WalletAccount {
window.localStorage.setItem(this._authDataKey, JSON.stringify(this._authData));
await this._moveKeyFromTempToPermanent(accountId, publicKey);
}
currentUrl.searchParams.delete('public_key');
currentUrl.searchParams.delete('account_id');
window.history.replaceState({}, document.title, currentUrl.toString());
}
async _moveKeyFromTempToPermanent(accountId, publicKey) {
const keyPair = await this._keyStore.getKey(this._networkId, PENDING_ACCESS_KEY_PREFIX + publicKey);
Expand Down
2 changes: 1 addition & 1 deletion dist/nearlib.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions lib/wallet-account.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src.ts/wallet-account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ export class WalletAccount {
window.localStorage.setItem(this._authDataKey, JSON.stringify(this._authData));
await this._moveKeyFromTempToPermanent(accountId, publicKey);
}
currentUrl.searchParams.delete('public_key');
currentUrl.searchParams.delete('account_id');
window.history.replaceState({}, document.title, currentUrl.toString());
}

async _moveKeyFromTempToPermanent(accountId: string, publicKey: string) {
Expand Down

0 comments on commit 385b79c

Please sign in to comment.