1.4.1 • Published 4 months ago

@mosaicapp/nest-js-auth-guard v1.4.1

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

nestjs-auth-guard

auth-guard lib

What is this repo for:

authorization guard to nestjs server that checks request.header.authorization field

This repo needs npm package

npm install safe-compare --save

How to add this repo to your project

Link this as a submodule

git submodule add https://github.com/LifeCoded/nestjs-auth-guard.git auth-guard

git submodule update --init

Only when this repo changes: Update submodule and push change to remote

git submodule update --remote --recursive

git add auth-guard

git commit

...

Adapt the code

add following code to bootstrap function in main.ts

app.useGlobalGuards(new AuthGuard(configService.getValue('AGENT_API_KEY'),app.get(Reflector)))

Or if configService doesn't exist:

app.useGlobalGuards(new AuthGuard(process.env.AGENT_API_KEY,app.get(Reflector)))

Github Workflow change

replace the previous checkout command with:

    steps:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        token: ${{ secrets.SUBMODULE_FETCH_TOKEN }}
        submodules: recursive

and add SUBMODULE_FETCH_TOKEN in project page

1.4.1

4 months ago

1.4.0

4 months ago

1.3.1

8 months ago

1.2.0

1 year ago

1.2.1

1 year ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago