Skip to content

Commit

Permalink
feat(com-api): add some new functions & edit config
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadhonarvar authored and njfamirm committed May 1, 2023
1 parent 1462466 commit 09e887b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion uniquely/com-api/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const config = {
},
token: <TokenGeneratorConfig>{
secret: process.env.SECRET ?? 'YOUR_SECRET',
algorithm: 'sha256',
algorithm: 'sha224',
encoding: 'base64url',
duration: null,
},
Expand Down
11 changes: 11 additions & 0 deletions uniquely/com-api/src/lib/sign-up.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {random} from '@alwatr/math';

import {tokenGenerator} from './token.js';

export const generateUserToken = (userId: string, lpe: number): string => {
return tokenGenerator.generate(userId + lpe);
};

export const generateUserId = (): string => {
return random.uuid;
};

0 comments on commit 09e887b

Please sign in to comment.