498 Invalid Token
An unofficial code indicating an expired or otherwise invalid token.
When and Why to Use It
Section titled “When and Why to Use It”Use this explicitly when JWTs or access tokens are invalid or expired, although 401 is more standard.
Usage Examples
Section titled “Usage Examples”import { HttpException, get } from 'shokupan';
export const getResource = get('/resource', () => { throw new HttpException('Invalid Token', 498);});import { Controller, Get, HttpException } from 'shokupan';
@Controller('/api')export class ExampleController { @Get('/resource') getResource() { throw new HttpException('Invalid Token', 498); }}import express from 'express';const app = express();
app.get('/resource', (req, res) => { res.status(498).json({ error: 'Invalid Token' });});import { Controller, Get, HttpException } from '@nestjs/common';
@Controller('api')export class ExampleController { @Get('resource') getResource() { throw new HttpException('Invalid Token', 498); }}import Koa from 'koa';const app = new Koa();
app.use(async ctx => { if (ctx.path === '/resource' && ctx.method === 'GET') { ctx.status = 498; ctx.body = { error: 'Invalid Token' }; }});