Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
Signed-off-by: Jochen Kressin <[email protected]>
  • Loading branch information
jochen-kressin committed Dec 31, 2023
1 parent 7c532e6 commit 2fe8a7c
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions server/auth/types/jwt/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,18 @@
* permissions and limitations under the License.
*/

import {
IRouter,
Logger,
SessionStorageFactory
} from 'opensearch-dashboards/server';
import { IRouter, Logger, SessionStorageFactory } from 'opensearch-dashboards/server';
import { SecuritySessionCookie } from '../../../session/security_cookie';
import { API_AUTH_LOGOUT, API_PREFIX } from '../../../../common';
import {
clearSplitCookies,
ExtraAuthStorageOptions
} from "../../../session/cookie_splitter";
import {JWT_DEFAULT_EXTRA_STORAGE_OPTIONS} from "./jwt_auth";
import {SecurityPluginConfigType} from "../../../index";
import { clearSplitCookies, ExtraAuthStorageOptions } from '../../../session/cookie_splitter';
import { JWT_DEFAULT_EXTRA_STORAGE_OPTIONS } from './jwt_auth';
import { SecurityPluginConfigType } from '../../../index';

export class JwtAuthRoutes {
constructor(
private readonly router: IRouter,
private readonly sessionStorageFactory: SessionStorageFactory<SecuritySessionCookie>,
private readonly config: SecurityPluginConfigType,
private readonly config: SecurityPluginConfigType
) {}

private getExtraAuthStorageOptions(logger?: Logger): ExtraAuthStorageOptions {
Expand All @@ -42,7 +35,7 @@ export class JwtAuthRoutes {
additionalCookies:
this.config.jwt?.extra_storage.additional_cookies ||
JWT_DEFAULT_EXTRA_STORAGE_OPTIONS.additionalCookies,
logger: logger,
logger,
};

return extraAuthStorageOptions;
Expand All @@ -58,10 +51,7 @@ export class JwtAuthRoutes {
},
},
async (context, request, response) => {
await clearSplitCookies(
request,
this.getExtraAuthStorageOptions()
);
await clearSplitCookies(request, this.getExtraAuthStorageOptions());
this.sessionStorageFactory.asScoped(request).clear();
return response.ok();
}
Expand Down

0 comments on commit 2fe8a7c

Please sign in to comment.