casdoor-js-sdk
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -31,5 +31,5 @@ export interface SdkConfig { | ||
getUserProfileUrl(userName: string, account: Account): string; | ||
getMyProfileUrl(account: Account): string; | ||
getMyProfileUrl(account: Account, returnUrl?: String): string; | ||
signin(serverUrl: string): Promise<Response>; | ||
} | ||
export default Sdk; |
@@ -59,8 +59,14 @@ "use strict"; | ||
} | ||
getMyProfileUrl(account) { | ||
let param = ""; | ||
getMyProfileUrl(account, returnUrl = "") { | ||
let params = ""; | ||
if (account !== undefined && account !== null) { | ||
param = `?access_token=${account.accessToken}`; | ||
params = `?access_token=${account.accessToken}`; | ||
if (returnUrl !== "") { | ||
params += `&return_url=${returnUrl}`; | ||
} | ||
} | ||
return `${this.config.serverUrl.trim()}/account${param}`; | ||
else if (returnUrl !== "") { | ||
params = `?return_url=${returnUrl}`; | ||
} | ||
return `${this.config.serverUrl.trim()}/account${params}`; | ||
} | ||
@@ -67,0 +73,0 @@ signin(serverUrl) { |
@@ -31,5 +31,5 @@ export interface SdkConfig { | ||
getUserProfileUrl(userName: string, account: Account): string; | ||
getMyProfileUrl(account: Account): string; | ||
getMyProfileUrl(account: Account, returnUrl?: String): string; | ||
signin(serverUrl: string): Promise<Response>; | ||
} | ||
export default Sdk; |
@@ -57,8 +57,14 @@ // Copyright 2021 The casbin Authors. All Rights Reserved. | ||
} | ||
getMyProfileUrl(account) { | ||
let param = ""; | ||
getMyProfileUrl(account, returnUrl = "") { | ||
let params = ""; | ||
if (account !== undefined && account !== null) { | ||
param = `?access_token=${account.accessToken}`; | ||
params = `?access_token=${account.accessToken}`; | ||
if (returnUrl !== "") { | ||
params += `&return_url=${returnUrl}`; | ||
} | ||
} | ||
return `${this.config.serverUrl.trim()}/account${param}`; | ||
else if (returnUrl !== "") { | ||
params = `?return_url=${returnUrl}`; | ||
} | ||
return `${this.config.serverUrl.trim()}/account${params}`; | ||
} | ||
@@ -65,0 +71,0 @@ signin(serverUrl) { |
{ | ||
"name": "casdoor-js-sdk", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "Javascript client SDK for Casdoor", | ||
@@ -5,0 +5,0 @@ "main": "lib/cjs/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28623
292