mirror of https://github.com/nocodb/nocodb
Pranav C
3 years ago
committed by
GitHub
3 changed files with 24 additions and 50 deletions
@ -0,0 +1,18 @@
|
||||
import * as jwt from 'jsonwebtoken'; |
||||
import User from '../../../models/User'; |
||||
import { NcConfig } from '../../../../interface/config'; |
||||
|
||||
export function genJwt(user: User, config: NcConfig) { |
||||
return jwt.sign( |
||||
{ |
||||
email: user.email, |
||||
firstname: user.firstname, |
||||
lastname: user.lastname, |
||||
id: user.id, |
||||
roles: user.roles, |
||||
token_version: user.token_version |
||||
}, |
||||
config.auth.jwt.secret, |
||||
config.auth.jwt.options |
||||
); |
||||
} |
Loading…
Reference in new issue