update token generation
This commit is contained in:
@ -1,3 +1,3 @@
|
||||
import rndstr from 'rndstr';
|
||||
|
||||
export default () => `!${rndstr('a-zA-Z0-9', 31)}`;
|
||||
export default () => `0${rndstr('a-zA-Z0-9', 15)}`;
|
||||
|
@ -1 +1 @@
|
||||
export default (token: string) => token.startsWith('!');
|
||||
export default (token: string) => token.startsWith('0');
|
||||
|
@ -38,7 +38,7 @@ export default define(meta, async (ps, user) => {
|
||||
}
|
||||
|
||||
// Generate access token
|
||||
const accessToken = rndstr('a-zA-Z0-9', 32);
|
||||
const accessToken = '1' + rndstr('a-zA-Z0-9', 15);
|
||||
|
||||
// Fetch exist access token
|
||||
const exist = await AccessTokens.findOne({
|
||||
|
Reference in New Issue
Block a user