Skip to content

Commit 9993be4

Browse files
f-alizadaFarhad Alizada
andauthored
Replace deprecated methods from cred generation (#2192)
* Replace deprecated methods from cred generation Co-authored-by: Farhad Alizada
1 parent f73c9b6 commit 9993be4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/components/users/change-password/ko/runtime/change-password.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class ChangePassword {
113113
}
114114

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

119119
if (!userId) {

‎src/services/usersService.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class UsersService {
3333
* @param password {string} Password.
3434
*/
3535
public async signInWithBasic(username: string, password: string): Promise<void> {
36-
const credentials = `Basic ${btoa(`${username}:${password}`)}`;
36+
const credentials = `Basic ${Buffer.from(`${username}:${password}`, "utf8").toString("base64")}`;
3737
const userId = await this.authenticate(credentials);
3838

3939
if (userId) {

0 commit comments

Comments
 (0)