Skip to content

Commit

Permalink
[Release] v1.0.2-rc1
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 47ebf00
Author: Thibaud RENAUX <[email protected]>
Date:   Wed Nov 3 09:41:59 2021 +0100

    update version tag

commit 12b540e
Author: Thibaud RENAUX <[email protected]>
Date:   Wed Nov 3 09:41:45 2021 +0100

    add slo to keyword tags

commit 30852ca
Author: Thibaud RENAUX <[email protected]>
Date:   Wed Nov 3 09:39:03 2021 +0100

    Feature/slo coupon (#37)

    * add optional parm for slo targetUrl

    * url builder for slo post revoke

    * run slo post revoke if slo coupon present

    * missing imports

    * remove console log

    * update index

commit 0651c8b
Author: Thibaud RENAUX <[email protected]>
Date:   Wed Oct 20 13:47:05 2021 +0200

    Release 1.0.1-rc1 (#35)

    * Release/v1.0.0 (#26)

    * Feature/locale region strings (#6)

    * add guard to client default_locale

    * format

    * add transaction guards

    * format

    * coverage

    * Feature v0.1.3 (#7)

    * update version number

    * update package versioné

    * Enhancement/rotation tokens (#9)

    * update versions

    * change constant value

    * use default rotation duration in client

    * fix main version

    * add missing imports

    * update rotation duratino to 1 month

    * switch to 1 month refresh token rotation

    * fix test about expiration

    * Use light server to make dev script environment

    * Handle leeway & retry in postpone refresh token

    * add rollup web worker plugin

    * configure web worker rollup

    * instanciate worker

    * ignore import of non module worker

    * improve worker initi

    * optional worker

    * add access to root path

    * fix reload of page

    * simplify authorization response formatting

    * missing interface

    * Fix test (wip)

    * @thib proposal of REFACTO Refresh token

    * Add condition to trigger handleRefresh if no access token but refresh token

    * improve response data parsing

    * debug postMessage

    * improve index

    * remove console logs in playground index

    * adapt client worker listener

    * remove logs from worker

    * update worker delayed action

    * remove logs from transaction

    * fix getTokensByRefresh return result

    * remove logs from client

    * adapt worker

    * return currentAccessTokenPresent in isAuthenticated func

    * fix build

    * make invitation detection not async

    * return result in then not only in finally

    * add port to config

    * clean up refreshTokensByRefresh

    * ensure tokens is present and valid to store tokens

    * avoid duplicated code

    * remove useless code

    * temp xit test

    * reactivate some coverage test

    * begin support of browser without workers

    * improve refreshParameters generation

    * revert canHandleWorker

    * update default scope constant

    * update interface of refreshStore

    * ensure values of expiration dates in refresh cookie

    * do not handle old browsers without refresh

    * improve canHandle guard function

    * fix reccurring worker handler

    * remove commented functions

    * better debugging

    * throw invalid_grant event if rotation reach refresh deadline

    * better expiration for cookies

    * clean up worker logs

    * log out when refresh not retrieved

    * format + fix build

    * remove / from config in playground

    * create new interfaces

    * handle tokens errors in client

    * guard to avoid cookies to be expires before now

    * unify transaction function using new interfaces

    * logout listener in index

    * handle log out from index

    * stop rotation if invalid grant

    * replace invalid grant listener in index

    * format

    * update client test using new default scope

    * update reload of dev index

    * remove logs

    * simplify test

    * fix storage test with new expiration

    * parse transaction errors

    * debug cookie expiration date

    * fix cookie expiration date + export parse Error

    * fix test + format

    * debug cookies attributes

    * set cookie expiration date at proper place

    * format + clean up

    Co-authored-by: jeremieflandrin002 <[email protected]>

    * [Feature] Implement simple worker (#14)

    * implement simple worker in client for more compatibility (react)

    * remove web worker loader and associated worker

    * clean up code

    * Feature/backoffice compatibility (#16)

    * use sample config that can be used by cryptr-app

    * add flexibility to jwt issuer validation

    * improve transaction sign url

    * update version

    * use original validateIssuer process

    * remove logs

    * improve issuer validation matcher

    * clean up PR code

    * format code

    * [Feature] Improve backoffice compatibility (#18)

    * improve Crypto.random on platforms
    * remove useless await
    * clean up code
    * debug handleredirect process

    * new debug

    * debug refresh process

    * remove logs

    * debug secure-random

    * add setnry to crypto

    * test new way for random bytes

    * add missing type

    * debg logout

    * debug logout response & callback

    * remove useless await

    * remove revoked_at presence guard for logout

    * reactivate revoked_at in logout process

    * cleanup + format

    * improve crypto rndom

    * switch try catch statement

    * Feature/improve multi uris (#20)

    * improve error processing

    * add some debug in process

    * debug access token validation

    * debug parseTokensAndStoreRefresh

    * clean up debugging

    * capture validation error to sentry

    * format code

    * debug erorrs in handle tokens errors

    * console error from handle tokens error

    * improve error printing

    * Feature/signin sso (#25)

    * use current config

    * create an sso sign type

    * redirect to enterprise login page for sso

    * remove logs

    * create sign in with sso method

    * integrate new function to index page

    * change idp_id

    * decorate signurl with state query param if sso transaction

    * avoid error when issuer check enterprise one

    * use idpId as required signwithSso process

    * remove useless comment

    * avoid call of signUrl if no idpId provided and SSO type

    * add transaction fixture for specific sign type

    * add transaction testsfor sso sign type

    * format code

    * test on client signWithSso fn

    * increase client tests around signWithSso fn

    * better iss vaidation for sso process

    * add validate sso metadata process

    * remove log

    * code clean up

    * remove testing on redirect uri for signin SSO

    * add sso in package tags

    * update version tag

    Co-authored-by: jeremieflandrin002 <[email protected]>

    * Release/v1.0.1 rc1 (#34)

    * Feature/locale region strings (#6)

    * add guard to client default_locale

    * format

    * add transaction guards

    * format

    * coverage

    * Feature v0.1.3 (#7)

    * update version number

    * update package versioné

    * Enhancement/rotation tokens (#9)

    * update versions

    * change constant value

    * use default rotation duration in client

    * fix main version

    * add missing imports

    * update rotation duratino to 1 month

    * switch to 1 month refresh token rotation

    * fix test about expiration

    * Use light server to make dev script environment

    * Handle leeway & retry in postpone refresh token

    * add rollup web worker plugin

    * configure web worker rollup

    * instanciate worker

    * ignore import of non module worker

    * improve worker initi

    * optional worker

    * add access to root path

    * fix reload of page

    * simplify authorization response formatting

    * missing interface

    * Fix test (wip)

    * @thib proposal of REFACTO Refresh token

    * Add condition to trigger handleRefresh if no access token but refresh token

    * improve response data parsing

    * debug postMessage

    * improve index

    * remove console logs in playground index

    * adapt client worker listener

    * remove logs from worker

    * update worker delayed action

    * remove logs from transaction

    * fix getTokensByRefresh return result

    * remove logs from client

    * adapt worker

    * return currentAccessTokenPresent in isAuthenticated func

    * fix build

    * make invitation detection not async

    * return result in then not only in finally

    * add port to config

    * clean up refreshTokensByRefresh

    * ensure tokens is present and valid to store tokens

    * avoid duplicated code

    * remove useless code

    * temp xit test

    * reactivate some coverage test

    * begin support of browser without workers

    * improve refreshParameters generation

    * revert canHandleWorker

    * update default scope constant

    * update interface of refreshStore

    * ensure values of expiration dates in refresh cookie

    * do not handle old browsers without refresh

    * improve canHandle guard function

    * fix reccurring worker handler

    * remove commented functions

    * better debugging

    * throw invalid_grant event if rotation reach refresh deadline

    * better expiration for cookies

    * clean up worker logs

    * log out when refresh not retrieved

    * format + fix build

    * remove / from config in playground

    * create new interfaces

    * handle tokens errors in client

    * guard to avoid cookies to be expires before now

    * unify transaction function using new interfaces

    * logout listener in index

    * handle log out from index

    * stop rotation if invalid grant

    * replace invalid grant listener in index

    * format

    * update client test using new default scope

    * update reload of dev index

    * remove logs

    * simplify test

    * fix storage test with new expiration

    * parse transaction errors

    * debug cookie expiration date

    * fix cookie expiration date + export parse Error

    * fix test + format

    * debug cookies attributes

    * set cookie expiration date at proper place

    * format + clean up

    Co-authored-by: jeremieflandrin002 <[email protected]>

    * [Feature] Implement simple worker (#14)

    * implement simple worker in client for more compatibility (react)

    * remove web worker loader and associated worker

    * clean up code

    * Feature/backoffice compatibility (#16)

    * use sample config that can be used by cryptr-app

    * add flexibility to jwt issuer validation

    * improve transaction sign url

    * update version

    * use original validateIssuer process

    * remove logs

    * improve issuer validation matcher

    * clean up PR code

    * format code

    * [Feature] Improve backoffice compatibility (#18)

    * improve Crypto.random on platforms
    * remove useless await
    * clean up code
    * debug handleredirect process

    * new debug

    * debug refresh process

    * remove logs

    * debug secure-random

    * add setnry to crypto

    * test new way for random bytes

    * add missing type

    * debg logout

    * debug logout response & callback

    * remove useless await

    * remove revoked_at presence guard for logout

    * reactivate revoked_at in logout process

    * cleanup + format

    * improve crypto rndom

    * switch try catch statement

    * Feature/improve multi uris (#20)

    * improve error processing

    * add some debug in process

    * debug access token validation

    * debug parseTokensAndStoreRefresh

    * clean up debugging

    * capture validation error to sentry

    * format code

    * debug erorrs in handle tokens errors

    * console error from handle tokens error

    * improve error printing

    * Feature/signin sso (#25)

    * use current config

    * create an sso sign type

    * redirect to enterprise login page for sso

    * remove logs

    * create sign in with sso method

    * integrate new function to index page

    * change idp_id

    * decorate signurl with state query param if sso transaction

    * avoid error when issuer check enterprise one

    * use idpId as required signwithSso process

    * remove useless comment

    * avoid call of signUrl if no idpId provided and SSO type

    * add transaction fixture for specific sign type

    * add transaction testsfor sso sign type

    * format code

    * test on client signWithSso fn

    * increase client tests around signWithSso fn

    * better iss vaidation for sso process

    * add validate sso metadata process

    * remove log

    * code clean up

    * remove testing on redirect uri for signin SSO

    * Fix/sso locale param (#28)

    * creagte new nterface for optional params

    * use created interface for optional params

    * add missing locale query param in sso final url

    * add new test button for locale sso switching

    * update test accordingly

    * Enhancement/url better cleanup (#30)

    * hotfix spelling

    * new config sample

    * only remove auth params from url

    * yarn format

    * Enhancement/handle multiple sso client ids (#31)

    * create interface dedicated to optional signinWithSso params

    * use new created interface

    * create specific button in dev to test custom client id

    * use new clientId attribute into transaction config

    * improve testing

    * yarn format

    * Enhancement/sso tenant domain option (#32)

    * add tenantDomain as optional parameter in SSO process

    * update transaction config to new attribute

    * update related tests

    * delete validatesSsoUserMetadata and update related tests (#33)

    * add missing sso keyword

    * change version tag

    * fix merge conflict failures

    Co-authored-by: jeremieflandrin002 <[email protected]>

    Co-authored-by: jeremieflandrin002 <[email protected]>

commit 32f7809
Author: Thibaud RENAUX <[email protected]>
Date:   Wed Oct 20 12:19:15 2021 +0200

    delete validatesSsoUserMetadata and update related tests (#33)

commit cd2f0a3
Author: Thibaud RENAUX <[email protected]>
Date:   Wed Oct 20 10:52:06 2021 +0200

    Enhancement/sso tenant domain option (#32)

    * add tenantDomain as optional parameter in SSO process

    * update transaction config to new attribute

    * update related tests

commit 822b4e8
Author: Thibaud RENAUX <[email protected]>
Date:   Wed Oct 20 08:53:21 2021 +0200

    Enhancement/handle multiple sso client ids (#31)

    * create interface dedicated to optional signinWithSso params

    * use new created interface

    * create specific button in dev to test custom client id

    * use new clientId attribute into transaction config

    * improve testing

    * yarn format

commit 596dd32
Author: Thibaud RENAUX <[email protected]>
Date:   Tue Oct 19 18:46:56 2021 +0200

    Enhancement/url better cleanup (#30)

    * hotfix spelling

    * new config sample

    * only remove auth params from url

    * yarn format

commit b944e65
Author: Thibaud RENAUX <[email protected]>
Date:   Tue Oct 19 18:20:50 2021 +0200

    Fix/sso locale param (#28)

    * creagte new nterface for optional params

    * use created interface for optional params

    * add missing locale query param in sso final url

    * add new test button for locale sso switching

    * update test accordingly

commit d7fd303
Author: Thibaud RENAUX <[email protected]>
Date:   Wed Sep 29 16:44:50 2021 +0200

    Feature/signin sso (#25)

    * use current config

    * create an sso sign type

    * redirect to enterprise login page for sso

    * remove logs

    * create sign in with sso method

    * integrate new function to index page

    * change idp_id

    * decorate signurl with state query param if sso transaction

    * avoid error when issuer check enterprise one

    * use idpId as required signwithSso process

    * remove useless comment

    * avoid call of signUrl if no idpId provided and SSO type

    * add transaction fixture for specific sign type

    * add transaction testsfor sso sign type

    * format code

    * test on client signWithSso fn

    * increase client tests around signWithSso fn

    * better iss vaidation for sso process

    * add validate sso metadata process

    * remove log

    * code clean up

    * remove testing on redirect uri for signin SSO

commit 2c4f1cd
Merge: 8122467 913aafd
Author: Thibaud RENAUX <[email protected]>
Date:   Fri Mar 26 10:26:41 2021 +0100

    [Release] v0.1.10
    * Improve error reporting

    Merge tag 'v0.1.10' into develop

    [Release] v0.1.10
    * Improve error reporting

commit 8122467
Author: Thibaud RENAUX <[email protected]>
Date:   Fri Mar 26 10:13:53 2021 +0100

    Feature/improve multi uris (#20)

    * improve error processing

    * add some debug in process

    * debug access token validation

    * debug parseTokensAndStoreRefresh

    * clean up debugging

    * capture validation error to sentry

    * format code

    * debug erorrs in handle tokens errors

    * console error from handle tokens error

    * improve error printing

commit fd2234d
Merge: 261739f c42d97e
Author: Thibaud RENAUX <[email protected]>
Date:   Wed Mar 24 15:14:10 2021 +0100

    [Release] v0.1.9
    * Improve Crypto random process

    Merge tag 'v0.1.9' into develop

    [Release] v0.1.9
    * Improve Crypto random process

commit 261739f
Author: Thibaud RENAUX <[email protected]>
Date:   Wed Mar 24 15:00:38 2021 +0100

    [Feature] Improve backoffice compatibility (#18)

    * improve Crypto.random on platforms
    * remove useless await
    * clean up code
    * debug handleredirect process

    * new debug

    * debug refresh process

    * remove logs

    * debug secure-random

    * add setnry to crypto

    * test new way for random bytes

    * add missing type

    * debg logout

    * debug logout response & callback

    * remove useless await

    * remove revoked_at presence guard for logout

    * reactivate revoked_at in logout process

    * cleanup + format

    * improve crypto rndom

    * switch try catch statement

commit 92ce835
Merge: 8d33d76 66a1b02
Author: Thibaud RENAUX <[email protected]>
Date:   Tue Mar 23 11:21:44 2021 +0100

    [Release] v0.1.8
    * Backoffice compatibility

    Merge tag 'v0.1.8' into develop

    [Release] v0.1.8
    * Backoffice compatibility

commit 8d33d76
Author: Thibaud RENAUX <[email protected]>
Date:   Tue Mar 23 11:12:52 2021 +0100

    Feature/backoffice compatibility (#16)

    * use sample config that can be used by cryptr-app

    * add flexibility to jwt issuer validation

    * improve transaction sign url

    * update version

    * use original validateIssuer process

    * remove logs

    * improve issuer validation matcher

    * clean up PR code

    * format code

commit 2bd05e0
Merge: 2bed4bf 7c5fb08
Author: Thibaud RENAUX <[email protected]>
Date:   Thu Mar 18 12:13:58 2021 +0100

    [Release] v0.1.7

    * use simple worker instead of web worker

    Merge tag 'v0.1.7' into develop

    [Release] v0.1.7

    * use simple worker instead of web worker

commit 2bed4bf
Author: Thibaud RENAUX <[email protected]>
Date:   Thu Mar 18 11:32:00 2021 +0100

    [Feature] Implement simple worker (#14)

    * implement simple worker in client for more compatibility (react)

    * remove web worker loader and associated worker

    * clean up code

commit cde5075
Merge: 1a3414a 98f631e
Author: Thibaud RENAUX <[email protected]>
Date:   Mon Mar 8 15:25:54 2021 +0100

    [Hotfix] v0.1.6
    * Handling token exp in seconds instead of milliseconds

    Merge tag 'v0.1.6' into develop

    [Hotfix] v0.1.6
    * Handling token exp in seconds instead of milliseconds

commit 1a3414a
Merge: 907fd34 b6bc527
Author: Thibaud RENAUX <[email protected]>
Date:   Fri Feb 19 15:08:54 2021 +0100

    Merge tag 'v0.1.5' into develop

    [Release] v0.1.5
    * default rotation duration in client
    * 1 month rotation
    * update version number
    * yarn for scripts

commit 907fd34
Author: Thibaud RENAUX <[email protected]>
Date:   Fri Feb 19 10:39:44 2021 +0100

    Enhancement/rotation tokens (#9)

    * update versions

    * change constant value

    * use default rotation duration in client

    * fix main version

    * add missing imports

    * update rotation duratino to 1 month

    * switch to 1 month refresh token rotation

    * fix test about expiration

    * Use light server to make dev script environment

    * Handle leeway & retry in postpone refresh token

    * add rollup web worker plugin

    * configure web worker rollup

    * instanciate worker

    * ignore import of non module worker

    * improve worker initi

    * optional worker

    * add access to root path

    * fix reload of page

    * simplify authorization response formatting

    * missing interface

    * Fix test (wip)

    * @thib proposal of REFACTO Refresh token

    * Add condition to trigger handleRefresh if no access token but refresh token

    * improve response data parsing

    * debug postMessage

    * improve index

    * remove console logs in playground index

    * adapt client worker listener

    * remove logs from worker

    * update worker delayed action

    * remove logs from transaction

    * fix getTokensByRefresh return result

    * remove logs from client

    * adapt worker

    * return currentAccessTokenPresent in isAuthenticated func

    * fix build

    * make invitation detection not async

    * return result in then not only in finally

    * add port to config

    * clean up refreshTokensByRefresh

    * ensure tokens is present and valid to store tokens

    * avoid duplicated code

    * remove useless code

    * temp xit test

    * reactivate some coverage test

    * begin support of browser without workers

    * improve refreshParameters generation

    * revert canHandleWorker

    * update default scope constant

    * update interface of refreshStore

    * ensure values of expiration dates in refresh cookie

    * do not handle old browsers without refresh

    * improve canHandle guard function

    * fix reccurring worker handler

    * remove commented functions

    * better debugging

    * throw invalid_grant event if rotation reach refresh deadline

    * better expiration for cookies

    * clean up worker logs

    * log out when refresh not retrieved

    * format + fix build

    * remove / from config in playground

    * create new interfaces

    * handle tokens errors in client

    * guard to avoid cookies to be expires before now

    * unify transaction function using new interfaces

    * logout listener in index

    * handle log out from index

    * stop rotation if invalid grant

    * replace invalid grant listener in index

    * format

    * update client test using new default scope

    * update reload of dev index

    * remove logs

    * simplify test

    * fix storage test with new expiration

    * parse transaction errors

    * debug cookie expiration date

    * fix cookie expiration date + export parse Error

    * fix test + format

    * debug cookies attributes

    * set cookie expiration date at proper place

    * format + clean up

    Co-authored-by: jeremieflandrin002 <[email protected]>

commit 913d40d
Merge: fe1b829 1bf515f
Author: Thibaud RENAUX <[email protected]>
Date:   Mon Feb 15 14:26:59 2021 +0100

    Merge tag 'v0.1.4' into develop

    [Release] v0.1.4
    * default rotation duration in client
    * 1 month rotation
    * update version number

commit fe1b829
Author: Thibaud RENAUX <[email protected]>
Date:   Wed Feb 10 13:22:46 2021 +0100

    Feature v0.1.3 (#7)

    * update version number

    * update package versioné

commit ae2747b
Author: Thibaud RENAUX <[email protected]>
Date:   Mon Feb 8 12:26:17 2021 +0100

    Feature/locale region strings (#6)

    * add guard to client default_locale

    * format

    * add transaction guards

    * format

    * coverage

commit 8490c8a
Merge: ad988b5 92f3fea
Author: Thibaud RENAUX <[email protected]>
Date:   Mon Feb 8 09:35:27 2021 +0100

    [Release] v0.1.2
    * types for Region and locale
    * rename enums file to types
    * update version numbers

    Merge tag 'v0.1.2' into develop

    [Release] v0.1.2
    * types for Region and locale
    * rename enums file to types
    * update version numbers

commit ad988b5
Merge: bc62a51 c7b49f2
Author: Thibaud RENAUX <[email protected]>
Date:   Mon Feb 8 08:25:37 2021 +0100

    [Release] v0.1.1
    - use types for locale and region
    - rename enums to types

    Merge branch 'release/v0.1.1' into develop
  • Loading branch information
tuxtux59 committed Nov 3, 2021
1 parent b692198 commit fa3ae7f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
10 changes: 6 additions & 4 deletions dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ <h1 class="card-title pricing-card-title">Profile <small class="text-muted">/ Op
<script>

var config = {
tenant_domain: 'first-tenant',
client_id: 'a183dfdf-938e-4dc1-a5cf-16e0910d7f12',
// tenant_domain: 'first-tenant',
tenant_domain: 'second-tenant',
client_id: 'f99fabc8-58e3-4953-ba0d-7ad77fa987ab',
// client_id: 'a183dfdf-938e-4dc1-a5cf-16e0910d7f12',
audience: 'http://localhost:8000',
default_redirect_uri: 'http://localhost:8000',
cryptr_base_url: 'https://samly.howto:4443',
Expand All @@ -138,12 +140,12 @@ <h1 class="card-title pricing-card-title">Profile <small class="text-muted">/ Op
document.getElementById("redirect-uri").innerText = config.default_redirect_uri;
document.getElementById("cryptr-base-url").innerText = config.cryptr_base_url;
var scopes = 'openid email';
const idpId = 'first_tenant_dA6vwVmxMjPFpbjU552jgi';
const idpId = 'second_tenant_5V8L2QucJyEiyrF86fo9cV';
// const idpId = 'first_tenant_dA6vwVmxMjPFpbjU552jgi';
const clientId2 = '9d187be3-ba46-4930-a728-672ae0c0d7f0'

var app = new Vue({
el: '#app',

data() {
return {
message: 'hello world',
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cryptr/cryptr-spa-js",
"description": "Cryptr SDK for Single Page Applications using passwordless authentication",
"version": "1.0.1-rc1",
"version": "release/v1.0.2-rc1",
"main": "dist/cryptr-spa-js.cjs.js",
"module": "dist/cryptr-spa-js.esm.js",
"browser": "dist/cryptr-spa-js.umd.js",
Expand Down Expand Up @@ -109,7 +109,8 @@
"client",
"token",
"user-account",
"sso"
"sso",
"slo"
],
"author": "Cryptr <[email protected]> (https://www.cryptr.co)",
"repository": {
Expand Down
10 changes: 7 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
DEFAULT_SCOPE,
} from './constants'
import { Sign } from './types'
import Request from './request'
import Request, { sloPostRevokeUrl } from './request'
import Storage from './storage'
import Transaction, { refreshKey } from './transaction'
import Jwt from './jwt'
Expand Down Expand Up @@ -368,15 +368,19 @@ class Client {
}
}

async logOut(callback: any, location = window.location) {
async logOut(callback: any, location = window.location, targetUrl = window.location.href) {
const accessToken = this.getCurrentAccessToken()
if (accessToken) {
Request.revokeAccessToken(this.config, accessToken)
.then(async (resp) => {
if (resp.data.revoked_at !== undefined) {
await Storage.clearCookies(this.config.client_id)
this.memory.clearTokens()
if (typeof callback === 'function' && callback !== null) {
if (resp.data.slo_coupon !== undefined) {
let sloCoupon = resp.data.slo_coupon
const url = sloPostRevokeUrl(this.config, sloCoupon, targetUrl)
window.location.assign(url.href)
} else if (typeof callback === 'function' && callback !== null) {
callback()
} else {
console.info('Default logOut callback : reload page')
Expand Down
8 changes: 8 additions & 0 deletions src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ export const revokeTokenUrl = (config: Config) => {
}/oauth/token/revoke`
}

export const sloPostRevokeUrl = (config: Config, sloCoupon: string, targetUrl: string) => {
let url: URL = new URL(cryptrBaseUrl(config))
url.pathname = `/api/${API_VERSION}/tenants/${config.tenant_domain}/${config.client_id}/oauth/token/slo_post_revoke`
url.searchParams.append('slo_coupon', sloCoupon)
url.searchParams.append('target_url', targetUrl)
return url
}

export const tokenUrl = (
config: Config,
authorization: Authorization,
Expand Down

0 comments on commit fa3ae7f

Please sign in to comment.