diff --git a/CHANGELOG.md b/CHANGELOG.md index c76ea87e..b07bd407 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ### Changed - Optimised checking for index availability right after they are created +- When clients request to regenerate their token, redirect them to a page with more explanations then the default login page. ### Fixed - none yet diff --git a/src/index.js b/src/index.js index 7e7768d1..2832ac97 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,4 @@ -/* global fetch */ +/* global fetch URL */ import 'babel-polyfill' import {unpromiser, retry, warn} from './utils' @@ -218,6 +218,11 @@ class Client { throw new Error('OAuth is not supported on the V2 stack') } if (this._oauth) { + if (forceTokenRefresh && this._clientParams.redirectURI) { + const url = new URL(this._clientParams.redirectURI) + if (!url.searchParams.has('reconnect')) url.searchParams.append('reconnect', 1) + this._clientParams.redirectURI = url.toString() + } return auth.oauthFlow( this, this._storage,