From 5f6ae489fa03a257b276060920345bf275b0316a Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Fri, 26 Dec 2025 23:16:55 +0530 Subject: [PATCH] AuthUser as model --- auth/src/context.tsx | 7 +------ auth/src/models.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 auth/src/models.ts diff --git a/auth/src/context.tsx b/auth/src/context.tsx index 8000314..a915b89 100644 --- a/auth/src/context.tsx +++ b/auth/src/context.tsx @@ -2,12 +2,7 @@ import React, { createContext, useContext, useEffect, useState } from "react"; import axios from "axios"; import { tokenStore } from "./token"; import { attachAuthInterceptors } from "./axios"; - -export interface AuthUser { - _id: string; - username: string; - [key: string]: any; -} +import { AuthUser } from "./models"; interface AuthContextModel { currentUser: AuthUser | null; diff --git a/auth/src/models.ts b/auth/src/models.ts new file mode 100644 index 0000000..fa1c352 --- /dev/null +++ b/auth/src/models.ts @@ -0,0 +1,11 @@ +export interface AuthUser { + // meta fields + _id?: string | null; + created_at: string; + updated_at: string; + + // model fields + username: string; + email: string; + is_active: boolean; +}