feat-dev: add U2F iframe for desktop client authentication (#2236)

This commit is contained in:
Karol Sójko
2023-03-07 00:52:35 +01:00
committed by GitHub
parent e5ca69fc8e
commit cf5330d7cf
25 changed files with 362 additions and 73 deletions

View File

@@ -1,5 +1,6 @@
import { UserRequestType } from '@standardnotes/common'
import { PreferenceId } from './../Preferences/PreferenceId'
import { AppViewRouteParam, ValidAppViewRoutes } from './Params/AppViewRouteParams'
import { DemoParams } from './Params/DemoParams'
import { OnboardingParams } from './Params/OnboardingParams'
import { PurchaseParams } from './Params/PurchaseParams'
@@ -78,6 +79,18 @@ export class RouteParser implements RouteParserInterface {
}
}
get appViewRouteParam(): AppViewRouteParam | undefined {
this.checkForProperRouteType(RouteType.AppViewRoute)
const appViewRoute = this.searchParams.get(RootQueryParam.AppViewRoute) as AppViewRouteParam
if (!ValidAppViewRoutes.includes(appViewRoute)) {
return
}
return this.searchParams.get(RootQueryParam.AppViewRoute) as AppViewRouteParam
}
private checkForProperRouteType(type: RouteType): void {
if (this.parsedType !== type) {
throw new Error('Accessing invalid params')
@@ -99,6 +112,7 @@ export class RouteParser implements RouteParserInterface {
[RootQueryParam.DemoToken, RouteType.Demo],
[RootQueryParam.AcceptSubscriptionInvite, RouteType.AcceptSubscriptionInvite],
[RootQueryParam.UserRequest, RouteType.UserRequest],
[RootQueryParam.AppViewRoute, RouteType.AppViewRoute],
])
for (const rootQueryParam of rootQueryParametersMap.keys()) {