feat: add list and create project

This commit is contained in:
Mauricio Siu
2024-06-05 01:43:19 -06:00
parent 9f033de1b2
commit bec0dfa57f
12 changed files with 249 additions and 16 deletions

View File

@@ -83,23 +83,17 @@ export default class Authenticate extends Command {
try {
console.log(`\n${chalk.blue("Validating server...")}`);
const response = await axios.post(
await axios.post(
`${url}/api/trpc/auth.verifyToken`,
{
json: {
token,
},
},
{},
{
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
},
);
if (!response.data.result.data.json) {
this.error(chalk.red("Invalid token"));
}
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
this.log(chalk.green("Authentication details saved successfully."));
} catch (error) {