File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -24,5 +24,8 @@ export default (): any => {
2424 process . env . KOMBIT_ROLE_NAME ||
2525 "http://os2iot.dk/roles/usersystemrole/adgang/" ,
2626 } ,
27+ chirpstack : {
28+ jwtsecret : process . env . CHIRPSTACK_JWTSECRET || "verysecret" ,
29+ } ,
2730 } ;
2831} ;
Original file line number Diff line number Diff line change 1- import { Injectable , Logger } from "@nestjs/common" ;
1+ import configuration from "@config/configuration" ;
2+ import { Injectable } from "@nestjs/common" ;
23// eslint-disable-next-line @typescript-eslint/ban-ts-comment
34// @ts -ignore
45import * as nJwt from "njwt" ;
@@ -16,9 +17,12 @@ export class JwtToken {
1617 username : "admin" , // username the client claims to be
1718 } ;
1819
19- const jwt = nJwt . create ( claims , "verysecret" , "HS256" ) ;
20+ const jwt = nJwt . create (
21+ claims ,
22+ configuration ( ) [ "chirpstack" ] [ "jwtsecret" ] ,
23+ "HS256"
24+ ) ;
2025 const token = jwt . compact ( ) ;
21- // Logger.verbose(`JWT token for Chirpstack: ${token}`);
2226 return token ;
2327 }
2428}
You can’t perform that action at this time.
0 commit comments