mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-13 10:37:33 +00:00
authorizeOrDenyDeviceAuthorization
This commit is contained in:
@@ -943,6 +943,31 @@ export async function getDeviceAuthorizationRequest({
|
||||
});
|
||||
}
|
||||
|
||||
export async function authorizeOrDenyDeviceAuthorization({
|
||||
serviceUrl,
|
||||
deviceAuthorizationId,
|
||||
session,
|
||||
}: {
|
||||
serviceUrl: string;
|
||||
deviceAuthorizationId: string;
|
||||
session?: { sessionId: string; sessionToken: string };
|
||||
}) {
|
||||
const oidcService = await createServiceForHost(OIDCService, serviceUrl);
|
||||
|
||||
return oidcService.authorizeOrDenyDeviceAuthorization({
|
||||
deviceAuthorizationId,
|
||||
decision: session
|
||||
? {
|
||||
case: "session",
|
||||
value: session,
|
||||
}
|
||||
: {
|
||||
case: "deny",
|
||||
value: {},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function createCallback({
|
||||
serviceUrl,
|
||||
req,
|
||||
|
Reference in New Issue
Block a user