Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vendure-plugin-disable-anonymous-access

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vendure-plugin-disable-anonymous-access

Disable anonymous access to shop-api and only allow to defined methods like authenticate

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
decreased by-21.43%
Maintainers
0
Weekly downloads
 
Created
Source

Vendure Plugin: Disable Anonymous Access

This plugin allows you to disable anonymous access to your Vendure e-commerce store. By requiring users to authenticate before accessing any content, you can enhance security and control access to your store.

Configuration

To configure the plugin, open your Vendure project's vendure-config.ts file and add the following code:

import { DisableAnonymousAccessPlugin } from 'vendure-plugin-disable-anonymous-access';

export const config: VendureConfig = {
  // ... other config options
  plugins: [
    // ... other plugins
    DisableAnonymousAccessPlugin.int({
      allowedMethods:["FirebaseAuth"]
    }),
  ],
};

Usage

Once the plugin is installed and configured, anonymous access will be disabled. Users will be required to authenticate before accessing any content on your Vendure store.

We still need to allow some methods like authenticate. This plugin extracts the graphql method name and checks if the method is within the allowed method defined in the options and allow that method to pass by without authentication. In the below, this is the body sent and since FirebaseAuth method is allowed, it bypasses.

body {
  operationName: null,
  variables: {
    uid: 'OWT6nismkIXDrqdZzCK5XXXXXXXXX',
    jwt: 'token'
  },
  query: 'mutation FirebaseAuth($uid: String!, $jwt: String!) {\n' +
    '  __typename\n' +
    '  authenticate(input: {firebase: {uid: $uid, jwt: $jwt}}) {\n' +
    '    __typename\n' +
    '  }\n' +
    '}'
}

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

Keywords

FAQs

Package last updated on 05 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc