Extracted login logic to independent component Login.tsx Implemented dummy password encryption logic Created LoginContext, login+registration handlers relevant type annots added untested change username function in main App button updated PAPERWORK and README
9 lines
313 B
TypeScript
9 lines
313 B
TypeScript
import { createContext } from "react";
|
|
import { LangType } from "./Chat/messageTypes";
|
|
export type LoginType = {
|
|
username: string;
|
|
lastSeen: number;
|
|
validUntil: number;
|
|
};
|
|
export const LangContext = createContext<LangType>("en_US");
|
|
export const LoginContext = createContext<LoginType | undefined>(undefined);
|