@bity/oauth2-auth-code-pkce
Advanced tools
Comparing version 2.8.3 to 2.9.0
11
index.js
@@ -393,4 +393,2 @@ "use strict"; | ||
this.setState(state); | ||
var urlWithoutQueryParams = OAuth2AuthCodePKCE.removeQueryParams(location.href); | ||
window.history.replaceState({}, '', urlWithoutQueryParams); | ||
return Promise.resolve(true); | ||
@@ -677,11 +675,2 @@ }; | ||
/** | ||
* Removes the query string parameters to clean up the URL. | ||
*/ | ||
OAuth2AuthCodePKCE.removeQueryParams = function (url) { | ||
var _a = url.split('?'), urlPart = _a[0], queryStringAndHashUrlPart = _a[1]; | ||
// @ts-ignore | ||
var _b = queryStringAndHashUrlPart.split('#'), _queryParamsPart = _b[0], hashUrlPart = _b[1]; | ||
return "" + urlPart + (hashUrlPart !== undefined ? "#" + hashUrlPart : ''); | ||
}; | ||
/** | ||
* Generates a code_verifier and code_challenge, as specified in rfc7636. | ||
@@ -688,0 +677,0 @@ */ |
12
index.ts
@@ -266,4 +266,2 @@ /** | ||
this.setState(state); | ||
const urlWithoutQueryParams = OAuth2AuthCodePKCE.removeQueryParams(location.href); | ||
window.history.replaceState({}, '', urlWithoutQueryParams); | ||
return Promise.resolve(true); | ||
@@ -595,12 +593,2 @@ } | ||
/** | ||
* Removes the query string parameters to clean up the URL. | ||
*/ | ||
static removeQueryParams(url: URL): string { | ||
const [urlPart, queryStringAndHashUrlPart] = url.split('?'); | ||
// @ts-ignore | ||
const [_queryParamsPart, hashUrlPart] = queryStringAndHashUrlPart.split('#'); | ||
return `${urlPart}${hashUrlPart !== undefined ? `#${hashUrlPart}` : ''}`; | ||
} | ||
/** | ||
* Generates a code_verifier and code_challenge, as specified in rfc7636. | ||
@@ -607,0 +595,0 @@ */ |
@@ -394,4 +394,2 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.OAuth2AuthCodePKCE = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
this.setState(state); | ||
var urlWithoutQueryParams = OAuth2AuthCodePKCE.removeQueryParams(location.href); | ||
window.history.replaceState({}, '', urlWithoutQueryParams); | ||
return Promise.resolve(true); | ||
@@ -678,11 +676,2 @@ }; | ||
/** | ||
* Removes the query string parameters to clean up the URL. | ||
*/ | ||
OAuth2AuthCodePKCE.removeQueryParams = function (url) { | ||
var _a = url.split('?'), urlPart = _a[0], queryStringAndHashUrlPart = _a[1]; | ||
// @ts-ignore | ||
var _b = queryStringAndHashUrlPart.split('#'), _queryParamsPart = _b[0], hashUrlPart = _b[1]; | ||
return "" + urlPart + (hashUrlPart !== undefined ? "#" + hashUrlPart : ''); | ||
}; | ||
/** | ||
* Generates a code_verifier and code_challenge, as specified in rfc7636. | ||
@@ -689,0 +678,0 @@ */ |
{ | ||
"name": "@bity/oauth2-auth-code-pkce", | ||
"version": "2.8.3", | ||
"version": "2.9.0", | ||
"description": "An OAuth 2.0 client that ONLY supports Authorization Code flow with PKCE support.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
126274
2024