Skip to content

Commit 9c81023

Browse files
committed
chore: update
1 parent e1ddf24 commit 9c81023

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

packages/core/src/node/rpc/anonymous/auth.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ import c from 'ansis'
55
export interface DevToolsAuthInput {
66
authId: string
77
ua: string
8+
origin: string
89
}
910

1011
export interface DevToolsAuthReturn {
1112
isTrusted: boolean
1213
}
1314

15+
// TODO: Replace with a proper storage solution
1416
const TEMPORARY_STORAGE = new Map<string, {
1517
authId: string
1618
ua: string
@@ -39,6 +41,7 @@ export const anonymousAuth = defineRpcFunction({
3941
`A browser is requesting permissions to connect to the Vite DevTools.`,
4042

4143
`User Agent: ${c.yellow(c.bold(query.ua || 'Unknown'))}`,
44+
`Origin : ${c.cyan(c.bold(query.origin || 'Unknown'))}`,
4245
`Identifier: ${c.green(c.bold(query.authId))}`,
4346
'',
4447
'This will allow the browser to interact with the server, make file changes and run commands.',
@@ -64,13 +67,13 @@ export const anonymousAuth = defineRpcFunction({
6467
session.meta.clientAuthId = query.authId
6568
session.meta.isTrusted = true
6669

67-
p.outro(c.green(c.bold('You have granted permissions to this client.')))
70+
p.outro(c.green(c.bold(`You have granted permissions to ${c.bold(query.authId)}`)))
6871
return {
6972
isTrusted: true,
7073
}
7174
}
7275

73-
p.outro(c.red(c.bold('You have denied permissions to this client.')))
76+
p.outro(c.red(c.bold(`You have denied permissions to ${c.bold(query.authId)}`)))
7477
return {
7578
isTrusted: false,
7679
}

packages/kit/src/client/rpc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ export async function getDevToolsRpcClient(
188188
const result = await serverRpc.$call('vite:anonymous:auth', {
189189
authId,
190190
ua,
191+
origin: location.origin,
191192
})
192193

193194
isTrusted = result.isTrusted

0 commit comments

Comments
 (0)