**Motivations :** - Replace PBKDF2 with WebAuthn for browser-native authentication - Enable secure credential storage using browser's built-in security - Require user interaction for credential generation - Store credentials in browser's credential manager **Modifications :** - Updated SecureCredentialsService to use WebAuthn instead of PBKDF2 - Added WebAuthn credential creation with platform authenticator - Implemented proper error handling for WebAuthn failures - Added fallback PBKDF2 method for compatibility - Fixed TypeScript errors in credential handling - Updated build configuration for WebAuthn support **Pages affectées :** - src/services/secure-credentials.service.ts (WebAuthn implementation) - vite.config.ts (WebAssembly and plugin configuration) - src/utils/sp-address.utils.ts (user interaction flow) - Build system (TypeScript compilation fixes)
69 lines
1.6 KiB
TypeScript
Executable File
69 lines
1.6 KiB
TypeScript
Executable File
import { defineConfig } from 'vite';
|
|
// import path from 'path';
|
|
// @ts-ignore - vite-plugin-wasm type definitions issue
|
|
import wasm from 'vite-plugin-wasm';
|
|
import topLevelAwait from 'vite-plugin-top-level-await';
|
|
|
|
export default defineConfig({
|
|
optimizeDeps: {
|
|
include: [],
|
|
// Exclude heavy dependencies from pre-bundling
|
|
exclude: ['pkg/sdk_client.js']
|
|
},
|
|
plugins: [
|
|
wasm(),
|
|
topLevelAwait()
|
|
],
|
|
build: {
|
|
outDir: 'dist',
|
|
target: 'esnext',
|
|
minify: true, // Enable minification to reduce size
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
// Split WebAssembly into separate chunk
|
|
'wasm': ['pkg/sdk_client.js']
|
|
}
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': '/src',
|
|
},
|
|
extensions: ['.ts', '.tsx', '.js'],
|
|
},
|
|
server: {
|
|
fs: {
|
|
cachedChecks: false,
|
|
},
|
|
port: 3004,
|
|
host: '0.0.0.0',
|
|
allowedHosts: [
|
|
'dev3.4nkweb.com',
|
|
'localhost',
|
|
'127.0.0.1',
|
|
'31.33.24.235'
|
|
],
|
|
proxy: {
|
|
'/storage': {
|
|
target: 'https://dev3.4nkweb.com',
|
|
changeOrigin: true,
|
|
secure: false,
|
|
rewrite: (path) => path.replace(/^\/storage/, '/storage'),
|
|
configure: (proxy, _options) => {
|
|
proxy.on('error', (err, _req, _res) => {
|
|
console.log('proxy error', err);
|
|
});
|
|
proxy.on('proxyReq', (_proxyReq, req, _res) => {
|
|
console.log('Sending Request:', req.method, req.url);
|
|
});
|
|
proxy.on('proxyRes', (proxyRes, req, _res) => {
|
|
console.log('Received Response:', proxyRes.statusCode, req.url);
|
|
});
|
|
}
|
|
}
|
|
}
|
|
},
|
|
});
|