Created
March 9, 2024 23:50
-
-
Save antonkalik/9e9b9ae391c963f3fe3fd50ddc7916b6 to your computer and use it in GitHub Desktop.
Token Service with refreshing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class TokenService { | |
private static jwt_secret = process.env.JWT_SECRET!; | |
public static refreshConfig = () => { | |
this.jwt_secret = process.env.JWT_SECRET!; | |
if (!this.jwt_secret) { | |
throw new Error('JWT secret not found in environment variables!'); | |
} | |
}; | |
// our verify and sign methods will be the same | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment