1.2.2 • Published 7 months ago

@bluelibs/x-ui-i18n-bundle v1.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

This bundle is to inject into the context the token read from the request and decoded to an userId via the SecurityBundle.

Installation

npm i -S @bluelibs/apollo-bundle @bluelibs/apollo-security-bundle
import { ApolloSecurityBundle } from "@bluelibs/apollo-security-bundle";

kernel.addBundle(
  new ApolloSecurityBundle({
    // options go here
  })
);

Options:

export interface IApolloSecurityBundleConfig {
  // All true by default
  support: {
    headers?: boolean,
    cookies?: boolean,
    websocket?: boolean,
  };
  // bluelibs-token is the default for all
  identifiers: {
    headers?: string,
    cookies?: string,
    // For websocket you have to send the connection params in order to work
    websocket?: string,
  };
}

Usage:

import { ISecurityContext } from "@bluelibs/apollo-security-bundle";

load({
  resolvers: {
    Query: {
      findMyPosts(_, args, context: ISecurityContext) {
        if (!context.userId) {
          // You can throw an error.
        }
      },
    },
  },
});

Support

This package is part of BlueLibs family. If you enjoy this work please show your support by starring the main package. If not, let us know what can we do to deserve it, our feedback form is here

1.2.2

7 months ago

1.2.1

8 months ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.0

3 years ago