File tree Expand file tree Collapse file tree 3 files changed +3
-2
lines changed Expand file tree Collapse file tree 3 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 1010env :
1111 TOKEN_SECRET : ${{ secrets.TOKEN_SECRET }}
1212 DB_URL : ${{ secrets.DB_URL }}
13+ ENVIRONMENT : ${{ secrets.ENVIRONMENT }}
1314
1415permissions :
1516 contents : read
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import jwt from "jsonwebtoken";
22import util from "#util" ;
33
44async function authenticateToken ( req , res , next ) {
5- if ( process . env . STATE === "Development " ) {
5+ if ( process . env . ENVIRONMENT === "local " ) {
66 return next ( ) ;
77 }
88 const authHeader = req . headers . authorization || req . headers . Authorization ;
Original file line number Diff line number Diff line change 11function authorization ( access = [ ] ) {
22 return ( req , res , next ) => {
33 // remove this in production
4- if ( process . env . STATE === "Development " ) {
4+ if ( process . env . ENVIRONMENT === "local " ) {
55 return next ( ) ;
66 }
77 if ( ! req . user ) return res . json ( { msg : "kindly login first" } ) ;
You can’t perform that action at this time.
0 commit comments