feat(snjs): add account recovery e2e test suite (#2134)
* feat(snjs): add account recovery e2e test suite * fix(snjs): request params in account recovery tests * fix(snjs): context password passing * refactor: replace factory functions with context Co-authored-by: Mo <mo@standardnotes.com>
This commit is contained in:
@@ -49,8 +49,10 @@ export class AuthApiService implements AuthApiServiceInterface {
|
||||
|
||||
try {
|
||||
const response = await this.authServer.recoveryKeyParams({
|
||||
apiVersion: ApiVersion.v0,
|
||||
...dto,
|
||||
api_version: ApiVersion.v0,
|
||||
code_challenge: dto.codeChallenge,
|
||||
recovery_codes: dto.recoveryCodes,
|
||||
username: dto.username,
|
||||
})
|
||||
|
||||
return response
|
||||
@@ -75,8 +77,11 @@ export class AuthApiService implements AuthApiServiceInterface {
|
||||
|
||||
try {
|
||||
const response = await this.authServer.signInWithRecoveryCodes({
|
||||
apiVersion: ApiVersion.v0,
|
||||
...dto,
|
||||
api_version: ApiVersion.v0,
|
||||
code_verifier: dto.codeVerifier,
|
||||
password: dto.password,
|
||||
recovery_codes: dto.recoveryCodes,
|
||||
username: dto.username,
|
||||
})
|
||||
|
||||
return response
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export interface RecoveryKeyParamsRequestParams {
|
||||
apiVersion: string
|
||||
api_version: string
|
||||
username: string
|
||||
codeChallenge: string
|
||||
recoveryCodes: string
|
||||
code_challenge: string
|
||||
recovery_codes: string
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export interface SignInWithRecoveryCodesRequestParams {
|
||||
apiVersion: string
|
||||
api_version: string
|
||||
username: string
|
||||
password: string
|
||||
codeVerifier: string
|
||||
recoveryCodes: string
|
||||
code_verifier: string
|
||||
recovery_codes: string
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ const SessionPaths = {
|
||||
}
|
||||
|
||||
const RecoveryPaths = {
|
||||
generateRecoveryCodes: '/v1/auth/recovery/codes',
|
||||
recoveryKeyParams: '/v1/auth/recovery/login-params',
|
||||
signInWithRecoveryCodes: '/v1/auth/recovery/login',
|
||||
generateRecoveryCodes: '/v1/recovery/codes',
|
||||
recoveryKeyParams: '/v1/recovery/login-params',
|
||||
signInWithRecoveryCodes: '/v1/recovery/login',
|
||||
}
|
||||
|
||||
export const Paths = {
|
||||
|
||||
Reference in New Issue
Block a user