0
Fork 0
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:
Ayush Sharma 2018-07-26 17:28:59 +02:00 committed by GitHub
commit ca76fdf55f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View file

@ -33,6 +33,7 @@
"global": "4.3.2",
"handlebars": "4.0.11",
"http-errors": "1.6.2",
"js-base64": "2.4.8",
"js-string-escape": "1.0.1",
"js-yaml": "3.11.0",
"jsonwebtoken": "8.2.1",

View file

@ -4,6 +4,7 @@ import isString from 'lodash/isString';
import isNumber from 'lodash/isNumber';
import capitalize from 'lodash/capitalize';
import {Link} from 'react-router-dom';
import {Base64} from 'js-base64';
import API from '../../utils/api';
import storage from '../../utils/storage';
@ -108,7 +109,7 @@ export default class Header extends React.Component {
}
try {
payload = JSON.parse(atob(payload));
payload = JSON.parse(Base64.decode(payload));
} catch (err) {
console.error('Invalid token:', err, token); // eslint-disable-line
return false;

BIN
yarn.lock

Binary file not shown.