@mosaicapp/nest-js-auth-guard
v1.4.1
Published
Simple nestjs auth guard module
Downloads
63
Maintainers
Keywords
Readme
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