Skip to content

Commit 3005dbb

Browse files
Merge pull request #350 from Web3Auth/fix/dashboard-urls
fix dashboard urls
2 parents 41737fb + c576b06 commit 3005dbb

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/core/auth.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ export class Auth {
4949
if (!options.sdkUrl && !options.useMpc) {
5050
if (options.buildEnv === BUILD_ENV.DEVELOPMENT) {
5151
options.sdkUrl = "http://localhost:3000";
52-
options.dashboardUrl = "http://localhost:5173/wallet/account";
52+
options.dashboardUrl = "http://localhost:5173";
5353
} else if (options.buildEnv === BUILD_ENV.STAGING) {
5454
options.sdkUrl = "https://staging-auth.web3auth.io";
55-
options.dashboardUrl = "https://staging-account.web3auth.io/wallet/account";
55+
options.dashboardUrl = "https://staging-account.web3auth.io";
5656
} else if (options.buildEnv === BUILD_ENV.TESTING) {
5757
options.sdkUrl = "https://develop-auth.web3auth.io";
58-
options.dashboardUrl = "https://develop-account.web3auth.io/wallet/account";
58+
options.dashboardUrl = "https://develop-account.web3auth.io";
5959
} else {
6060
options.sdkUrl = "https://auth.web3auth.io";
61-
options.dashboardUrl = "https://account.web3auth.io/wallet/account";
61+
options.dashboardUrl = "https://account.web3auth.io";
6262
}
6363
}
6464

@@ -129,6 +129,12 @@ export class Auth {
129129
return `${this.options.sdkUrl}/v${version.split(".")[0]}`;
130130
}
131131

132+
private get dashboardUrl(): string {
133+
// testing and develop don't have versioning
134+
if (!this.addVersionInUrls) return `${this.options.sdkUrl}`;
135+
return `${this.options.sdkUrl}/v${version.split(".")[0]}`;
136+
}
137+
132138
async init(): Promise<void> {
133139
// get sessionNamespace from the redirect result.
134140
const params = getHashQueryParams(this.options.replaceUrlOnRedirect);
@@ -303,7 +309,7 @@ export class Auth {
303309
// in case of redirect mode, redirect url will be dapp specified
304310
// in case of popup mode, redirect url will be sdk specified
305311
const defaultParams = {
306-
redirectUrl: this.options.dashboardUrl,
312+
redirectUrl: `${this.dashboardUrl}/wallet/account`,
307313
dappUrl: `${window.location.origin}${window.location.pathname}`,
308314
};
309315

0 commit comments

Comments
 (0)