|
@@ -15,7 +15,7 @@ import { UseCaseInterface } from './UseCaseInterface'
|
|
import { PKCERepositoryInterface } from '../User/PKCERepositoryInterface'
|
|
import { PKCERepositoryInterface } from '../User/PKCERepositoryInterface'
|
|
import { CrypterInterface } from '../Encryption/CrypterInterface'
|
|
import { CrypterInterface } from '../Encryption/CrypterInterface'
|
|
import { SignInDTOV2Challenged } from './SignInDTOV2Challenged'
|
|
import { SignInDTOV2Challenged } from './SignInDTOV2Challenged'
|
|
-import { ProtocolVersion } from '@standardnotes/common'
|
|
|
|
|
|
+import { leftVersionGreaterThanOrEqualToRight, ProtocolVersion } from '@standardnotes/common'
|
|
import { HttpStatusCode } from '@standardnotes/api'
|
|
import { HttpStatusCode } from '@standardnotes/api'
|
|
import { EmailLevel } from '@standardnotes/domain-core'
|
|
import { EmailLevel } from '@standardnotes/domain-core'
|
|
import { getBody, getSubject } from '../Email/UserSignedIn'
|
|
import { getBody, getSubject } from '../Email/UserSignedIn'
|
|
@@ -59,7 +59,12 @@ export class SignIn implements UseCaseInterface {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (user.version === ProtocolVersion.V004 && !performingCodeChallengedSignIn) {
|
|
|
|
|
|
+ const userVersionIs004OrGreater = leftVersionGreaterThanOrEqualToRight(
|
|
|
|
+ user.version as ProtocolVersion,
|
|
|
|
+ ProtocolVersion.V004,
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ if (userVersionIs004OrGreater && !performingCodeChallengedSignIn) {
|
|
return {
|
|
return {
|
|
success: false,
|
|
success: false,
|
|
errorMessage: 'Please update your client application.',
|
|
errorMessage: 'Please update your client application.',
|