Add authenticated login and SSO protection
This commit is contained in:
@@ -320,12 +320,14 @@ async function syncEvolinkImageJob(job: GenerationJob, origin: string): Promise<
|
||||
});
|
||||
}
|
||||
|
||||
export async function retryImageJob(jobId: string, origin: string): Promise<GenerationJob> {
|
||||
export async function retryImageJob(jobId: string, origin: string, ownerId?: string): Promise<GenerationJob> {
|
||||
const job = await getGenerationJob(jobId);
|
||||
if (!job) throw new Error(`Generation job not found: ${jobId}`);
|
||||
if (ownerId && job.ownerId !== ownerId) throw new Error(`Generation job not found: ${jobId}`);
|
||||
const input = (job.requestPayload.input || {}) as SubmitImageJobInput;
|
||||
return submitImageJob({
|
||||
...input,
|
||||
ownerId: ownerId || job.ownerId,
|
||||
capability: job.capability as EnabledImageCapability,
|
||||
retryOf: job.id
|
||||
}, origin);
|
||||
|
||||
Reference in New Issue
Block a user