Skip to content

Commit

Permalink
Merge pull request #209 from y-lohse/reconnect
Browse files Browse the repository at this point in the history
feat: redirect to special reconnect page
  • Loading branch information
y-lohse authored Sep 25, 2017
2 parents 70ce975 + a867d6f commit 4c1c6ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global fetch */
/* global fetch URL */
import 'babel-polyfill'

import {unpromiser, retry, warn} from './utils'
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4c1c6ae

Please sign in to comment.