{"version":3,"file":"logout.cjs","names":["logoutData: LogoutOptions"],"sources":["../../../../src/rest/commands/auth/logout.ts"],"sourcesContent":["import type { LogoutOptions } from '../../../index.js';\nimport type { RestCommand } from '../../types.js';\n\n/**\n * Invalidate the refresh token thus destroying the user's session.\n *\n * @param options Optional logout settings.\n *\n * @returns Empty body.\n */\nexport const logout =\n\t<Schema>(options: LogoutOptions = {}): RestCommand<void, Schema> =>\n\t() => {\n\t\tconst logoutData: LogoutOptions = {\n\t\t\tmode: options.mode ?? 'cookie',\n\t\t};\n\n\t\tif (logoutData.mode === 'json' && options.refresh_token) {\n\t\t\tlogoutData['refresh_token'] = options.refresh_token;\n\t\t}\n\n\t\treturn {\n\t\t\tpath: '/auth/logout',\n\t\t\tmethod: 'POST',\n\t\t\tbody: JSON.stringify(logoutData),\n\t\t};\n\t};\n"],"mappings":"AAUA,MAAa,GACH,EAAyB,EAAE,OAC9B,CACL,IAAMA,EAA4B,CACjC,KAAM,EAAQ,MAAQ,SACtB,CAMD,OAJI,EAAW,OAAS,QAAU,EAAQ,gBACzC,EAAW,cAAmB,EAAQ,eAGhC,CACN,KAAM,eACN,OAAQ,OACR,KAAM,KAAK,UAAU,EAAW,CAChC"}