Skip to content

Commit

Permalink
Replace deprecated methods from cred generation (#2192)
Browse files Browse the repository at this point in the history
* Replace deprecated methods from cred generation

Co-authored-by: Farhad Alizada <falizada@microsoft.com>
  • Loading branch information
f-alizada and Farhad Alizada authored Jun 1, 2023
1 parent f73c9b6 commit 9993be4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class ChangePassword {
}

const user = await this.usersService.getCurrentUser();
const credentials = `Basic ${btoa(`${user.email}:${this.password()}`)}`;
const credentials = `Basic ${Buffer.from(`${user.email}:${this.password()}`, "utf8").toString("base64")}`;
let userId = await this.usersService.authenticate(credentials);

if (!userId) {
Expand Down
2 changes: 1 addition & 1 deletion src/services/usersService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class UsersService {
* @param password {string} Password.
*/
public async signInWithBasic(username: string, password: string): Promise<void> {
const credentials = `Basic ${btoa(`${username}:${password}`)}`;
const credentials = `Basic ${Buffer.from(`${username}:${password}`, "utf8").toString("base64")}`;
const userId = await this.authenticate(credentials);

if (userId) {
Expand Down

0 comments on commit 9993be4

Please sign in to comment.