Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Allow redis options in session storage #430

Merged
merged 1 commit into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## Unreleased

- Allow passing in options for the Redis client used by the session storage strategy [#430](https://github.com/Shopify/shopify-api-node/pull/430)

## [4.2.0] - 2022-07-20

- Return a 401 instead of 403 when webhooks fail validation [#425](https://github.com/Shopify/shopify-api-node/pull/425)
Expand Down
5 changes: 3 additions & 2 deletions src/auth/session/storage/redis.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {createClient, RedisClientType} from 'redis';
import {createClient, RedisClientType, RedisClientOptions} from 'redis';

import {SessionInterface} from '../types';
import {SessionStorage} from '../session_storage';
import {sessionFromEntries, sessionEntries} from '../session-utils';

export interface RedisSessionStorageOptions {
export interface RedisSessionStorageOptions extends RedisClientOptions {
sessionKeyPrefix: string;
}
const defaultRedisSessionStorageOptions: RedisSessionStorageOptions = {
Expand Down Expand Up @@ -103,6 +103,7 @@ export class RedisSessionStorage implements SessionStorage {

private async init() {
this.client = createClient({
...this.options,
url: this.dbUrl.toString(),
});
await this.client.connect();
Expand Down