Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/hello.js
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,14 @@ hello.utils.extend(hello.utils, {
// Is this an auth relay message which needs to call the proxy?
p = _this.param(location.search);

// Decode back possible Base64-encoded state
if (p && p.state) {
const base64regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
if (base64regex.test(p.state)) {
p.state = window.atob(p.state);
}
}

// OAuth2 or OAuth1 server response?
if (p && p.state && (p.code || p.oauth_token)) {

Expand Down