nstantpage-agent 0.5.30 → 0.5.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -194,6 +194,21 @@ export async function startCommand(directory, options) {
194
194
  if (!token && isLocalGateway) {
195
195
  token = 'local-dev';
196
196
  }
197
+ // Check token expiry before connecting
198
+ if (token && token !== 'local-dev') {
199
+ try {
200
+ const parts = token.split('.');
201
+ if (parts.length === 3) {
202
+ const payload = JSON.parse(Buffer.from(parts[1], 'base64').toString('utf-8'));
203
+ if (payload.exp && payload.exp < Date.now() / 1000) {
204
+ console.log(chalk.red('✗ Your authentication token has expired.'));
205
+ console.log(chalk.gray(' Run "nstantpage login" to re-authenticate.'));
206
+ process.exit(1);
207
+ }
208
+ }
209
+ }
210
+ catch { }
211
+ }
197
212
  // Determine project ID (optional — without it, agent enters standby mode)
198
213
  // Only use explicitly passed --project-id, never fall back to stored value
199
214
  let projectId = options.projectId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nstantpage-agent",
3
- "version": "0.5.30",
3
+ "version": "0.5.31",
4
4
  "description": "Local development agent for nstantpage.com — run your projects locally, preview in the cloud. Replaces cloud containers for faster builds.",
5
5
  "type": "module",
6
6
  "bin": {