Skip to content

Commit

Permalink
Merge pull request #34 from digital-asset/bump-1-0-0
Browse files Browse the repository at this point in the history
release v1.0.0
  • Loading branch information
alexmatson-da authored Jan 6, 2022
2 parents 37dccef + 2281e0c commit fb4a28e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daml/hub-react",
"version": "1.0.0-rc.5",
"version": "1.0.0",
"description": "Daml React functions for Daml Hub",
"homepage": "https://hub.daml.com",
"keywords": [
Expand Down Expand Up @@ -50,8 +50,8 @@
"typescript": "~3.8.3"
},
"peerDependencies": {
"react": "^16.12.0",
"react-dom": "^16.12.0"
"react": "^16.12.0 || ^17.0.0",
"react-dom": "^16.12.0 || ^17.0.0"
},
"resolutions": {
"@types/react": "^16.9.20"
Expand Down
12 changes: 10 additions & 2 deletions src/login/DamlHubLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ interface LoginOptions {
}

export const damlHubLogout = (): void => {
const hostname = damlHubEnvironment()?.hostname || 'projectdabl.com';

if (detectAppDomainType() === DomainType.LEGACY_DOMAIN) {
deleteCookie(DABL_LEDGER_ACCESS_TOKEN, 'projectdabl.com');
deleteCookie(DAMLHUB_LEDGER_ACCESS_TOKEN, 'projectdabl.com');
deleteCookie(DABL_LEDGER_ACCESS_TOKEN, hostname);
deleteCookie(DAMLHUB_LEDGER_ACCESS_TOKEN, hostname);
} else if (detectAppDomainType() === DomainType.APP_DOMAIN) {
deleteCookie(DAMLHUB_LEDGER_ACCESS_TOKEN);
}
Expand Down Expand Up @@ -145,6 +147,12 @@ const ButtonLogin: React.FC<DamlHubLoginProps> = props => {
const ledgerId = hubEnv?.ledgerId;

if (tokenFromCookie) {
if (detectAppDomainType() === DomainType.LEGACY_DOMAIN) {
const url = new URL(window.location.toString());
url.search = '';
window.history.replaceState(window.history.state, '', url.toString());
}

try {
const at = new PartyToken(tokenFromCookie);
if (
Expand Down

0 comments on commit fb4a28e

Please sign in to comment.