From f43db2f46ee50bacb402a6ef42d768694c2bc9a8 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 12 Mar 2021 15:20:46 +0100 Subject: Refactor auth flow Reimplement some node-oauth2-server methods to remove hacky code needed by our external login workflow --- server/models/account/user-notification-setting.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/models/account/user-notification-setting.ts') diff --git a/server/models/account/user-notification-setting.ts b/server/models/account/user-notification-setting.ts index de1501299..138051528 100644 --- a/server/models/account/user-notification-setting.ts +++ b/server/models/account/user-notification-setting.ts @@ -12,10 +12,10 @@ import { Table, UpdatedAt } from 'sequelize-typescript' +import { TokensCache } from '@server/lib/auth/tokens-cache' import { MNotificationSettingFormattable } from '@server/types/models' import { UserNotificationSetting, UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model' import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications' -import { clearCacheByUserId } from '../../lib/oauth-model' import { throwIfNotValid } from '../utils' import { UserModel } from './user' @@ -195,7 +195,7 @@ export class UserNotificationSettingModel extends Model { @AfterUpdate @AfterDestroy static removeTokenCache (instance: UserNotificationSettingModel) { - return clearCacheByUserId(instance.userId) + return TokensCache.Instance.clearCacheByUserId(instance.userId) } toFormattedJSON (this: MNotificationSettingFormattable): UserNotificationSetting { -- cgit v1.2.3