Skip to content

Commit 79e7479

Browse files
authored
Ignore stored tokens for other URLs (#584)
1 parent 21797db commit 79e7479

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/auth.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ export async function getAuth(options: getAuthOptions = {}): Promise<Auth> {
285285
data = await options.loadTokens();
286286
}
287287

288-
if (data) {
288+
// If the token is for another url, ignore it
289+
if (data && (hassUrl === undefined || data.hassUrl === hassUrl)) {
289290
return new Auth(data, options.saveTokens);
290291
}
291292

0 commit comments

Comments
 (0)