Skip to main content
Glama
alexander-zuev

Kollektiv | Your private LLM knowledgebase

authErrorHandler.ts1.46 kB
// // TODO: This will be integrated in the next release // // import {authService} from 'src/features/auth'; // import {logger} from '@/lib/logger'; // // /** // * Responsible for handling auth-related errors by either refreshing session or logging user out. // * // * @param statusCode - HTTP status code // * @param errorCode - Optional error code // */ // export async function authErrorHandler(statusCode: 401 | 403, errorCode?: string): Promise<void> { // // const {signOut, refreshSession} = authService(); // // switch (statusCode) { // case 401: // // Refresh session // logger.debug('Retrying authentication'); // const {success} = await refreshSession(); // // if (success) { // // do nothing on success -> this will be handled by the api client // } else { // logger.debug('Failed to refresh session, signing out'); // // sign user out // await signOut(); // } // break; // case 403: // if (errorCode === 'user_banned' || errorCode === 'user_not_found') { // logger.debug('User banned or not found, signing out'); // // in this case sign user out // await signOut(); // } // break; // default: // // do nothing - we can't do much // break; // } // }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alexander-zuev/kollektiv-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server