зеркало из https://github.com/mozilla/fxa.git
refactor(auth): convert account to TS and class
Because: * New routes and some account cleanup is needed for allowing a new account with no password. This requires multiple re-usable functions to be extracted from the existing create account handler. This commit: * Converts the account.js file to TypeScript and refactors the handlers into a class to make room for the new account creation route. Ref #8735
This commit is contained in:
Родитель
9e20080fef
Коммит
ef2d33a38a
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -4,6 +4,8 @@
|
|||
import { Request, RequestApplicationState } from '@hapi/hapi';
|
||||
import { Logger } from 'mozlog';
|
||||
|
||||
export type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T;
|
||||
|
||||
/**
|
||||
* Auth-Server specific interfaces to use objects.
|
||||
*
|
||||
|
@ -27,8 +29,26 @@ export interface AuthLogger extends Logger {
|
|||
export interface AuthApp extends RequestApplicationState {
|
||||
devices: Promise<any>;
|
||||
locale: String;
|
||||
acceptLanguage: String;
|
||||
clientAddress: string;
|
||||
metricsContext: any;
|
||||
accountRecreated: boolean;
|
||||
ua: {
|
||||
browser: string;
|
||||
browserVersion: string;
|
||||
os: string;
|
||||
osVersion: string;
|
||||
deviceType: string;
|
||||
formFactor: string;
|
||||
};
|
||||
isSuspiciousRequest: boolean;
|
||||
geo: {
|
||||
location: { city: string; state: string; country: string };
|
||||
location: {
|
||||
city: string;
|
||||
state: string;
|
||||
country: string;
|
||||
countryCode: string;
|
||||
};
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
|
@ -36,4 +56,9 @@ export interface AuthApp extends RequestApplicationState {
|
|||
export interface AuthRequest extends Request {
|
||||
log: AuthLogger;
|
||||
app: AuthApp;
|
||||
validateMetricsContext: any;
|
||||
setMetricsFlowCompleteSignal: any;
|
||||
emitMetricsEvent: any;
|
||||
stashMetricsContext: any;
|
||||
propagateMetricsContext: any;
|
||||
}
|
||||
|
|
|
@ -118,6 +118,7 @@
|
|||
"@types/node-zendesk": "^2.0.2",
|
||||
"@types/request": "2.48.5",
|
||||
"@types/safe-regex": "1.1.2",
|
||||
"@types/uuid": "^8.3.0",
|
||||
"@types/verror": "^1.10.4",
|
||||
"acorn": "^8.0.1",
|
||||
"audit-filter": "^0.5.0",
|
||||
|
|
|
@ -16,5 +16,6 @@ declare namespace LoggerConfigFactory {
|
|||
warning(type: string, fields: object): void;
|
||||
warn(type: string, fields: object): void;
|
||||
verbose(type: string, fields: object): void;
|
||||
trace(type: string, fields: object): void;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18085,6 +18085,7 @@ fsevents@~2.1.1:
|
|||
"@types/node-zendesk": ^2.0.2
|
||||
"@types/request": 2.48.5
|
||||
"@types/safe-regex": 1.1.2
|
||||
"@types/uuid": ^8.3.0
|
||||
"@types/verror": ^1.10.4
|
||||
acorn: ^8.0.1
|
||||
ajv: ^6.12.2
|
||||
|
|
Загрузка…
Ссылка в новой задаче