@@ -5,7 +5,7 @@ import prisma from "@/utils/database";
55import * as noblox from "noblox.js" ;
66import bcryptjs from "bcryptjs" ;
77import { setRegistry } from "@/utils/registryManager" ;
8- import { getRobloxUserId } from "@/utils/roblox" ;
8+ import { getRobloxUserId , isGroupAllied } from "@/utils/roblox" ;
99import { createSession } from "@/utils/session" ;
1010
1111type Data = {
@@ -67,6 +67,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
6767
6868 let groupName = `Group ${ groupIdNumber } ` ;
6969 let groupLogo = '' ;
70+ let isVerified = false ;
7071
7172 try {
7273 const [ logo , group ] = await Promise . all ( [
@@ -75,12 +76,13 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
7576 ] ) ;
7677 if ( group ) groupName = group . name ;
7778 if ( logo ) groupLogo = logo ;
79+ if ( await isGroupAllied ( groupIdNumber ) ) { isVerified = true } ;
7880 } catch ( err ) {
7981 console . error ( 'Failed to fetch group info during workspace setup:' , err ) ;
8082 }
8183
8284 await prisma . workspace . create ( {
83- data : { groupId : groupIdNumber , groupName, groupLogo, lastSynced : new Date ( ) } ,
85+ data : { groupId : groupIdNumber , groupName, groupLogo, lastSynced : new Date ( ) , isVerified , lastSyncedSuccessful : ! ! opencloudKey } ,
8486 } ) . catch ( ( e ) => { throw new Error ( "Failed to create workspace" ) } ) ;
8587
8688 await prisma . $transaction ( [
0 commit comments