File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed
Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -667,13 +667,13 @@ export function createRouter(ctx: RouterContext) {
667667 const token = config . auth ?. token ;
668668 return {
669669 hasToken : ! ! token ,
670- tokenPreview : token ? `${ token . slice ( 0 , 10 ) } ...${ token . slice ( - 4 ) } ` : undefined ,
670+ tokenPreview : token ? `${ token . slice ( 0 , 4 ) } ...${ token . slice ( - 4 ) } ` : undefined ,
671671 } ;
672672 } ) ;
673673
674674 const generateAuthToken = os . output ( z . object ( { token : z . string ( ) } ) ) . handler ( async ( ) => {
675675 const currentConfig = ctx . config . get ( ) ;
676- const token = `perry- ${ crypto . randomBytes ( 16 ) . toString ( 'hex' ) } ` ;
676+ const token = crypto . randomBytes ( 12 ) . toString ( 'hex' ) ;
677677 const newConfig = { ...currentConfig , auth : { ...currentConfig . auth , token } } ;
678678 ctx . config . set ( newConfig ) ;
679679 await saveAgentConfig ( newConfig , ctx . configDir ) ;
Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ async function ensureAuthForNewInstalls(configDir: string): Promise<AgentConfig>
269269 const config = await loadAgentConfig ( configDir ) ;
270270
271271 if ( ! configExists && ! config . auth ?. token ) {
272- const token = `perry- ${ crypto . randomBytes ( 16 ) . toString ( 'hex' ) } ` ;
272+ const token = crypto . randomBytes ( 12 ) . toString ( 'hex' ) ;
273273 config . auth = { ...config . auth , token } ;
274274 await saveAgentConfig ( config , configDir ) ;
275275
Original file line number Diff line number Diff line change @@ -360,7 +360,7 @@ function SetupWizard() {
360360 } ;
361361
362362 const generateAuthToken = ( ) => {
363- const token = `perry- ${ crypto . randomBytes ( 16 ) . toString ( 'hex' ) } ` ;
363+ const token = crypto . randomBytes ( 12 ) . toString ( 'hex' ) ;
364364 setState ( ( s ) => ( {
365365 ...s ,
366366 authToken : token ,
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export async function authInit(): Promise<void> {
1111 return ;
1212 }
1313
14- const token = `perry- ${ crypto . randomBytes ( 16 ) . toString ( 'hex' ) } ` ;
14+ const token = crypto . randomBytes ( 12 ) . toString ( 'hex' ) ;
1515 config . auth = { ...config . auth , token } ;
1616 await saveAgentConfig ( config , configDir ) ;
1717
You can’t perform that action at this time.
0 commit comments