fix: replace frontend with Rust OPAQUE API + Flutter keypad UI
- Full OPAQUE auth flow via WASM client SDK (client-wasm crate) - New user: Key Register → Key Login → Code Register (icon selection) → done - Existing user: Key Login → get login-data → icon keypad → Code Login → done - Icon-based keypad matching Flutter design: - 2 cols portrait, 3 cols landscape - Key tiles with 3-col sub-grid of icons - Navy border press feedback - Dot display with backspace + submit - SVGs rendered as-is (no color manipulation) - SusiPage with Login/Signup tabs - LoginKeypadPage and SignupKeypadPage for code flows - Secret key display/copy on signup - Unit tests for Keypad component - WASM pkg bundled locally (no external dep)
This commit is contained in:
36
src/types/index.ts
Normal file
36
src/types/index.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/** Auth state stored in localStorage */
|
||||
export interface AuthState {
|
||||
email: string | null
|
||||
secretKeyHex: string | null
|
||||
userId: string | null
|
||||
}
|
||||
|
||||
/** Icon from the WASM client */
|
||||
export interface NKodeIcon {
|
||||
file_name: string
|
||||
file_type: string
|
||||
img_data: string
|
||||
}
|
||||
|
||||
/** Response from prepareCodeRegistration */
|
||||
export interface IconsResponse {
|
||||
icons: NKodeIcon[]
|
||||
}
|
||||
|
||||
/** Response from prepareCodeLogin */
|
||||
export interface CodeLoginData {
|
||||
keypadIndices: number[]
|
||||
propertiesPerKey: number
|
||||
numberOfKeys: number
|
||||
mask: number[]
|
||||
icons: NKodeIcon[]
|
||||
loginDataJson: string
|
||||
}
|
||||
|
||||
/** Session returned from loginKey / loginCode */
|
||||
export interface NKodeSession {
|
||||
sessionId: string
|
||||
userId: string
|
||||
createdAt: string
|
||||
expiresAt: string
|
||||
}
|
||||
19
src/types/nkode-client-wasm.d.ts
vendored
19
src/types/nkode-client-wasm.d.ts
vendored
@@ -1,19 +0,0 @@
|
||||
/**
|
||||
* Type stub for the nKode WASM package.
|
||||
* Will be replaced by real types when the package is linked via `bun link`.
|
||||
*/
|
||||
declare module 'nkode-client-wasm' {
|
||||
export class NKodeClient {
|
||||
constructor(base_url: string);
|
||||
loginCode(email: string, passcode_bytes: Uint8Array): Promise<any>;
|
||||
loginKey(email: string, secret_key_hex: string): Promise<any>;
|
||||
registerCode(email: string, passcode_bytes: Uint8Array): Promise<void>;
|
||||
registerKey(email: string, secret_key_hex: string): Promise<void>;
|
||||
static generateSecretKey(): string;
|
||||
free(): void;
|
||||
}
|
||||
|
||||
export function init(): void;
|
||||
|
||||
export default function __wbg_init(module_or_path?: any): Promise<any>;
|
||||
}
|
||||
Reference in New Issue
Block a user