diff --git a/browser/package.json b/browser/package.json index 9d65008..a0040ae 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@janishutz/oidc-login-sdk-browser", - "version": "1.0.0", + "version": "1.1.0", "description": "SDK to communicate with and log into a backend running express-openid-connect", "homepage": "https://github.com/janishutz/oidc-login-sdk-browser#readme", "bugs": { diff --git a/browser/src/auth.ts b/browser/src/auth.ts index 316a85c..c8b7022 100644 --- a/browser/src/auth.ts +++ b/browser/src/auth.ts @@ -5,7 +5,7 @@ import config from './config.js'; export const login = ( returnTo?: string ) => { sessionStorage.setItem( 'redirect', location.pathname ); - location.href = ( config.get().loginEndpoint ?? '/auth/v2/login' ) + returnTo ? returnTo : ''; + location.href = ( config.get().loginEndpoint ?? '/auth/v2/login' ) + ( returnTo ? returnTo : '' ); }; export const check = async () => { diff --git a/distribute.sh b/distribute.sh new file mode 100755 index 0000000..d16f344 --- /dev/null +++ b/distribute.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +cd browser +./build.sh +cd dist +npm publish + +cd ../../server +./build.sh +cd dist +npm publish diff --git a/server/package.json b/server/package.json index c129eb9..5a49862 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "@janishutz/oidc-login-sdk-server", - "version": "1.0.0", + "version": "1.1.0", "description": "Small wrapper on top of express-openid-connect to work together with my browser sdk", "homepage": "https://github.com/janishutz/oidc-login-sdk-browser#readme", "bugs": {