Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

casdoor-js-sdk

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

casdoor-js-sdk - npm Package Compare versions

Comparing version 0.5.1 to 0.6.0

3

lib/cjs/sdk.d.ts

@@ -7,2 +7,3 @@ export interface SdkConfig {

redirectPath?: string;
signinPath?: string;
}

@@ -33,4 +34,4 @@ export interface Account {

getMyProfileUrl(account: Account, returnUrl?: String): string;
signin(serverUrl: string): Promise<Response>;
signin(serverUrl: string, signinPath?: string): Promise<Response>;
}
export default Sdk;

@@ -72,3 +72,3 @@ "use strict";

}
signin(serverUrl) {
signin(serverUrl, signinPath) {
const params = new URLSearchParams(window.location.search);

@@ -90,3 +90,3 @@ const code = params.get("code");

}
return fetch(`${serverUrl}/api/signin?code=${code}&state=${state}`, {
return fetch(`${serverUrl}${signinPath || this.config.signinPath || '/api/signin'}?code=${code}&state=${state}`, {
method: "POST",

@@ -93,0 +93,0 @@ credentials: "include",

@@ -7,2 +7,3 @@ export interface SdkConfig {

redirectPath?: string;
signinPath?: string;
}

@@ -33,4 +34,4 @@ export interface Account {

getMyProfileUrl(account: Account, returnUrl?: String): string;
signin(serverUrl: string): Promise<Response>;
signin(serverUrl: string, signinPath?: string): Promise<Response>;
}
export default Sdk;

@@ -70,3 +70,3 @@ // Copyright 2021 The casbin Authors. All Rights Reserved.

}
signin(serverUrl) {
signin(serverUrl, signinPath) {
const params = new URLSearchParams(window.location.search);

@@ -88,3 +88,3 @@ const code = params.get("code");

}
return fetch(`${serverUrl}/api/signin?code=${code}&state=${state}`, {
return fetch(`${serverUrl}${signinPath || this.config.signinPath || '/api/signin'}?code=${code}&state=${state}`, {
method: "POST",

@@ -91,0 +91,0 @@ credentials: "include",

{
"name": "casdoor-js-sdk",
"version": "0.5.1",
"version": "0.6.0",
"description": "Javascript client SDK for Casdoor",

@@ -5,0 +5,0 @@ "main": "lib/cjs/index.js",

@@ -47,2 +47,3 @@ # casdoor-js-sdk

| redirectPath | No | the path of the redirect URL for your Casdoor application, will be `/callback` if not provided |
| signinPath | No | the path of the signin URL for your Casdoor application, will be `/api/signin` if not provided |

@@ -58,2 +59,3 @@ ```typescript

redirectPath: "/callback",
signinPath: "/api/signin",
}

@@ -81,2 +83,3 @@ const sdk = new SDK(sdkConfig)

redirectPath: "/callback",
signinPath: "/api/signin",
}

@@ -132,3 +135,3 @@ window.sdk = new SDK(sdkConfig)

```typescript
signin(serverUrl)
signin(serverUrl, signinPath)
```

@@ -135,0 +138,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc