Skip to content

Commit 4f29464

Browse files
eternal-flame-ADjmattheis
authored andcommitted
use js-base64 for password base64 encoding
1 parent a1360e4 commit 4f29464

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

ui/package-lock.json

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"axios": "^0.18.0",
1010
"codemirror": "^5.43.0",
1111
"detect-browser": "^3.0.0",
12+
"js-base64": "^2.5.1",
1213
"mobx": "^5.1.1",
1314
"mobx-react": "^5.2.8",
1415
"mobx-utils": "^5.0.2",
@@ -40,6 +41,7 @@
4041
"@types/detect-browser": "^2.0.1",
4142
"@types/get-port": "^4.0.0",
4243
"@types/jest": "^23.3.1",
44+
"@types/js-base64": "^2.3.1",
4345
"@types/node": "^10.9.0",
4446
"@types/notifyjs": "^3.0.0",
4547
"@types/puppeteer": "^1.6.3",

ui/src/CurrentUser.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import axios, {AxiosResponse} from 'axios';
22
import * as config from './config';
3+
import {Base64} from 'js-base64';
34
import {detect} from 'detect-browser';
45
import {SnackReporter} from './snack/SnackManager';
56
import {observable} from 'mobx';
@@ -47,7 +48,7 @@ export class CurrentUser {
4748
url: config.get('url') + 'client',
4849
method: 'POST',
4950
data: {name},
50-
auth: {username, password},
51+
headers: {Authorization: 'Basic ' + Base64.encode(username + ':' + password)},
5152
})
5253
.then((resp: AxiosResponse<IClient>) => {
5354
this.snack(`A client named '${name}' was created for your session.`);

0 commit comments

Comments
 (0)