AuthUser as model
This commit is contained in:
@@ -2,12 +2,7 @@ import React, { createContext, useContext, useEffect, useState } from "react";
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { tokenStore } from "./token";
|
import { tokenStore } from "./token";
|
||||||
import { attachAuthInterceptors } from "./axios";
|
import { attachAuthInterceptors } from "./axios";
|
||||||
|
import { AuthUser } from "./models";
|
||||||
export interface AuthUser {
|
|
||||||
_id: string;
|
|
||||||
username: string;
|
|
||||||
[key: string]: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AuthContextModel {
|
interface AuthContextModel {
|
||||||
currentUser: AuthUser | null;
|
currentUser: AuthUser | null;
|
||||||
|
|||||||
11
auth/src/models.ts
Normal file
11
auth/src/models.ts
Normal file
@@ -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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user