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

Commit

Permalink
Merge pull request #430 from Shopify/add_redis_client_options
Browse files Browse the repository at this point in the history
Allow redis options in session storage
  • Loading branch information
paulomarg authored Jul 25, 2022
2 parents 20c8b8d + 7ea3f39 commit 16c8e33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit 16c8e33

Please # to comment.