mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 17:56:30 -05:00
fix(deps): migrate zxcvbn
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
4ed6f5fed1
commit
0263c09ce1
1 changed files with 19 additions and 8 deletions
|
@ -5,9 +5,20 @@
|
||||||
*/
|
*/
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
import { zxcvbnAsync, zxcvbnOptions } from '@zxcvbn-ts/core';
|
import {
|
||||||
import zxcvbnCommonPackage from '@zxcvbn-ts/language-common';
|
OptionsGraph,
|
||||||
import zxcvbnEnPackage from '@zxcvbn-ts/language-en';
|
OptionsType,
|
||||||
|
zxcvbnAsync,
|
||||||
|
zxcvbnOptions,
|
||||||
|
} from '@zxcvbn-ts/core';
|
||||||
|
import {
|
||||||
|
adjacencyGraphs,
|
||||||
|
dictionary as zxcvbnCommonDictionary,
|
||||||
|
} from '@zxcvbn-ts/language-common';
|
||||||
|
import {
|
||||||
|
dictionary as zxcvbnEnDictionary,
|
||||||
|
translations as zxcvbnEnTranslations,
|
||||||
|
} from '@zxcvbn-ts/language-en';
|
||||||
import { Repository } from 'typeorm';
|
import { Repository } from 'typeorm';
|
||||||
|
|
||||||
import authConfiguration, { AuthConfig } from '../config/auth.config';
|
import authConfiguration, { AuthConfig } from '../config/auth.config';
|
||||||
|
@ -34,13 +45,13 @@ export class IdentityService {
|
||||||
private authConfig: AuthConfig,
|
private authConfig: AuthConfig,
|
||||||
) {
|
) {
|
||||||
this.logger.setContext(IdentityService.name);
|
this.logger.setContext(IdentityService.name);
|
||||||
const options = {
|
const options: OptionsType = {
|
||||||
dictionary: {
|
dictionary: {
|
||||||
...zxcvbnCommonPackage.dictionary,
|
...zxcvbnCommonDictionary,
|
||||||
...zxcvbnEnPackage.dictionary,
|
...zxcvbnEnDictionary,
|
||||||
},
|
},
|
||||||
graphs: zxcvbnCommonPackage.adjacencyGraphs,
|
graphs: adjacencyGraphs as OptionsGraph,
|
||||||
translations: zxcvbnEnPackage.translations,
|
translations: zxcvbnEnTranslations,
|
||||||
};
|
};
|
||||||
zxcvbnOptions.setOptions(options);
|
zxcvbnOptions.setOptions(options);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue