Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export class Auth {
}> {
const securityDetails = await this.securityDetails(details.email);
const encryptedSalt = securityDetails.encryptedSalt;
const encryptedPasswordHash = cryptoProvider.encryptPasswordHash(details.password, encryptedSalt);
const encryptedPasswordHash = await cryptoProvider.encryptPasswordHash(details.password, encryptedSalt);
const keys = await cryptoProvider.generateKeys(details.password);

return this.client
Expand Down
2 changes: 1 addition & 1 deletion src/auth/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface Keys {
}

export interface CryptoProvider {
encryptPasswordHash: (password: Password, encryptedSalt: string) => string;
encryptPasswordHash: (password: Password, encryptedSalt: string) => Promise<string>;
generateKeys: (password: Password) => Promise<Keys>;
}

Expand Down
2 changes: 1 addition & 1 deletion src/drive/share/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
UpdateUserRolePayload,
UpdateUserRoleResponse,
} from './types';
import { ItemType } from 'src/workspaces';
import { ItemType } from '../../workspaces';

export * as ShareTypes from './types';

Expand Down
6 changes: 3 additions & 3 deletions test/auth/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ describe('# auth service tests', () => {
tfaCode: undefined,
};
const cryptoProvider: CryptoProvider = {
encryptPasswordHash: () => '',
encryptPasswordHash: () => Promise.resolve(''),
generateKeys: (password: Password) => {
const keys: Keys = {
privateKeyEncrypted: '',
Expand Down Expand Up @@ -211,7 +211,7 @@ describe('# auth service tests', () => {
tfaCode: undefined,
};
const cryptoProvider: CryptoProvider = {
encryptPasswordHash: () => '',
encryptPasswordHash: () => Promise.resolve(''),
generateKeys: (password: Password) => {
const keys: Keys = {
privateKeyEncrypted: '',
Expand Down Expand Up @@ -254,7 +254,7 @@ describe('# auth service tests', () => {
tfaCode: undefined,
};
const cryptoProvider: CryptoProvider = {
encryptPasswordHash: (password, encryptedSalt) => password + '-' + encryptedSalt,
encryptPasswordHash: (password, encryptedSalt) => Promise.resolve(password + '-' + encryptedSalt),
generateKeys: (password: Password) => {
const keys: Keys = {
privateKeyEncrypted: 'priv',
Expand Down