Skip to content

Commit

Permalink
Merge pull request #23 from privacybydesign/location-hash-fix
Browse files Browse the repository at this point in the history
Fix: don't strip location hash in url to prevent hashchange events
  • Loading branch information
ivard authored Aug 24, 2022
2 parents ef39e18 + 1ac686d commit 472ddcb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 1 addition & 2 deletions src/components/registration_verified/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class RegistrationVerified extends React.Component {

continueToMyIrma(e) {
e.preventDefault();
window.location.hash = '';
this.props.dispatch({ type: 'loggedIn' });
}

Expand Down Expand Up @@ -72,7 +71,7 @@ class RegistrationVerified extends React.Component {
)}
</p>
<p>
<a href={'/#'} onClick={() => this.continueToMyIrma()}>
<a href={'/#'} onClick={(e) => this.continueToMyIrma(e)}>
{this.t('continue-to-myirma')}
</a>
</p>
Expand Down
2 changes: 0 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ function checkUrlHash() {
if (fragment.startsWith('#token=')) {
const token = fragment.substr(7);
store.dispatch({ type: 'startTokenLogin', token: token });
window.location.hash = '';
} else if (fragment.startsWith('#verify=')) {
const token = fragment.substr(8);
store.dispatch({ type: 'startRegistrationVerify', token: token });
window.location.hash = '';
} else {
store.dispatch({ type: 'verifySession' });
}
Expand Down

0 comments on commit 472ddcb

Please sign in to comment.