mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
Merge pull request #851 from verdaccio/#840-atob-not-support-unicode-strings
feat: adds base64 support in webui token (#840)
This commit is contained in:
commit
ca76fdf55f
3 changed files with 3 additions and 1 deletions
|
@ -33,6 +33,7 @@
|
||||||
"global": "4.3.2",
|
"global": "4.3.2",
|
||||||
"handlebars": "4.0.11",
|
"handlebars": "4.0.11",
|
||||||
"http-errors": "1.6.2",
|
"http-errors": "1.6.2",
|
||||||
|
"js-base64": "2.4.8",
|
||||||
"js-string-escape": "1.0.1",
|
"js-string-escape": "1.0.1",
|
||||||
"js-yaml": "3.11.0",
|
"js-yaml": "3.11.0",
|
||||||
"jsonwebtoken": "8.2.1",
|
"jsonwebtoken": "8.2.1",
|
||||||
|
|
|
@ -4,6 +4,7 @@ import isString from 'lodash/isString';
|
||||||
import isNumber from 'lodash/isNumber';
|
import isNumber from 'lodash/isNumber';
|
||||||
import capitalize from 'lodash/capitalize';
|
import capitalize from 'lodash/capitalize';
|
||||||
import {Link} from 'react-router-dom';
|
import {Link} from 'react-router-dom';
|
||||||
|
import {Base64} from 'js-base64';
|
||||||
|
|
||||||
import API from '../../utils/api';
|
import API from '../../utils/api';
|
||||||
import storage from '../../utils/storage';
|
import storage from '../../utils/storage';
|
||||||
|
@ -108,7 +109,7 @@ export default class Header extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
payload = JSON.parse(atob(payload));
|
payload = JSON.parse(Base64.decode(payload));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Invalid token:', err, token); // eslint-disable-line
|
console.error('Invalid token:', err, token); // eslint-disable-line
|
||||||
return false;
|
return false;
|
||||||
|
|
BIN
yarn.lock
BIN
yarn.lock
Binary file not shown.
Loading…
Reference in a new issue