mirror of
https://github.com/langchain-ai/langgraphjs.git
synced 2026-07-22 17:15:25 -04:00
fix(sdk): use kind when checking for Studio user (#1411)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
---
|
||||
"@langchain/langgraph-api": patch
|
||||
"@langchain/langgraph-ui": patch
|
||||
"@langchain/langgraph-cli": patch
|
||||
"@langchain/langgraph-sdk": patch
|
||||
---
|
||||
|
||||
fix(sdk): use `kind` when checking for Studio user
|
||||
@@ -61,6 +61,7 @@ export const handleAuthEvent = async <T extends keyof AuthEventValueMap>(
|
||||
};
|
||||
|
||||
const STUDIO_USER = {
|
||||
kind: "StudioUser",
|
||||
display_name: "langgraph-studio-user",
|
||||
identity: "langgraph-studio-user",
|
||||
permissions: [],
|
||||
|
||||
@@ -49,6 +49,7 @@ export class Auth<
|
||||
* @returns True if the user is a studio user, false otherwise
|
||||
*/
|
||||
export function isStudioUser(user: BaseUser) {
|
||||
if ("kind" in user && user.kind === "StudioUser") return true;
|
||||
return user.identity === "langgraph-studio-user";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user