Skip to content

Commit

Permalink
chore(release): 1.20.0 [skip ci]
Browse files Browse the repository at this point in the history
# [1.20.0](v1.19.5...v1.20.0) (2023-01-25)

### Features

* **state:** Base64 encoding instead of uri encoding of state param for yahoo ([#658](#658)) ([b196a7b](b196a7b))
  • Loading branch information
semantic-release-bot committed Jan 25, 2023
1 parent 3d1fe6e commit c1f2f42
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [1.20.0](https://github.com/MrSwitch/hello.js/compare/v1.19.5...v1.20.0) (2023-01-25)


### Features

* **state:** Base64 encoding instead of uri encoding of state param for yahoo ([#658](https://github.com/MrSwitch/hello.js/issues/658)) ([b196a7b](https://github.com/MrSwitch/hello.js/commit/b196a7b72c265280d16e1296be6b39619c23169c))

## [1.19.5](https://github.com/MrSwitch/hello.js/compare/v1.19.4...v1.19.5) (2021-09-19)


Expand Down
14 changes: 11 additions & 3 deletions dist/hello.all.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! hellojs v1.19.5 - (c) 2012-2021 Andrew Dodson - MIT https://adodson.com/hello.js/LICENSE */
/*! hellojs v1.20.0 - (c) 2012-2023 Andrew Dodson - MIT https://adodson.com/hello.js/LICENSE */
// ES5 Object.create
if (!Object.create) {

Expand Down Expand Up @@ -528,7 +528,12 @@ hello.utils.extend(hello, {
}

// Convert state to a string
p.qs.state = encodeURIComponent(JSON.stringify(p.qs.state));
if (provider.oauth.base64_state) {
p.qs.state = window.btoa(JSON.stringify(p.qs.state));
}
else {
p.qs.state = encodeURIComponent(JSON.stringify(p.qs.state));
}

// URL
if (parseInt(provider.oauth.version, 10) === 1) {
Expand Down Expand Up @@ -5796,7 +5801,10 @@ if (typeof chrome === 'object' && typeof chrome.identity === 'object' && chrome.
version: '1.0a',
auth: 'https://api.login.yahoo.com/oauth/v2/request_auth',
request: 'https://api.login.yahoo.com/oauth/v2/get_request_token',
token: 'https://api.login.yahoo.com/oauth/v2/get_token'
token: 'https://api.login.yahoo.com/oauth/v2/get_token',
// Yahoo requires the state param to be base 64 encoded, hence the flag base64_state is set to true for Yahoo.
// Else uri encoding is used for all the other providers.
base64_state: true
},

// Login handler
Expand Down
4 changes: 2 additions & 2 deletions dist/hello.all.min.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions dist/hello.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! hellojs v1.19.5 - (c) 2012-2021 Andrew Dodson - MIT https://adodson.com/hello.js/LICENSE */
/*! hellojs v1.20.0 - (c) 2012-2023 Andrew Dodson - MIT https://adodson.com/hello.js/LICENSE */
// ES5 Object.create
if (!Object.create) {

Expand Down Expand Up @@ -528,7 +528,12 @@ hello.utils.extend(hello, {
}

// Convert state to a string
p.qs.state = encodeURIComponent(JSON.stringify(p.qs.state));
if (provider.oauth.base64_state) {
p.qs.state = window.btoa(JSON.stringify(p.qs.state));
}
else {
p.qs.state = encodeURIComponent(JSON.stringify(p.qs.state));
}

// URL
if (parseInt(provider.oauth.version, 10) === 1) {
Expand Down
4 changes: 2 additions & 2 deletions dist/hello.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hellojs",
"version": "1.19.5",
"version": "1.20.0",
"description": "A clientside Javascript library for standardizing requests to OAuth2 web services (and OAuth1 - with a shim)",
"homepage": "https://adodson.com/hello.js",
"main": "dist/hello.all.js",
Expand Down

0 comments on commit c1f2f42

Please sign in to comment.