Welcome!
Address:
Work Time:
The Universal Wallet Authentication system provides single sign-on (SSO) across your entire platform. Users connect their wallet ONCE and stay authenticated across all pages.
- ✅ Single Sign-On: Connect once, authenticated everywhere
Add these scripts to your HTML:
`html
``html
`
`html
`
`html
`
`html
`
`javascript
await window.authIntegration.init({
showUI: false, // Don't show default UI
onAuthSuccess: (authInfo) => {
// Show custom UI
document.getElementById('userAddress').textContent = authInfo.shortAddress;
document.getElementById('workTime').textContent = authInfo.workTimeMinutes + ' mins';
},
onAuthFail: () => {
// Show login prompt
}
});
`
`javascript
// Connect wallet manually
document.getElementById('myConnectBtn').addEventListener('click', async () => {
try {
const authInfo = await window.universalWalletAuth.connect();
} catch (error) {
console.error('Connection failed:', error);
}
});
`
`javascript
// Check if authenticated
if (window.authIntegration.isAuthenticated()) {
const authInfo = window.authIntegration.getAuthInfo();
}
`
`javascript
// Disconnect and clear session
await window.authIntegration.disconnect();
`
Time tracking automatically starts for approved contractors:
- ✅ Tracks active time on platform
`javascript
`localStorage:
barbrick_auth_session - Full session databarbrick_wallet_address - Current addressbarbrick_wallet_type - 'ethereum' or 'solana'`javascript
// Approved Contractor
if (window.universalWalletAuth.isApprovedContractor()) {
}
`
System Architect wallets (case-insensitive):
0xEFc6910e7624F164dAe9d0F799954aa69c943c8d0x4ccbefd7d3554bcbbc489b11af73a84d7baef4cbListen for auth events:
`javascript
// Logout
window.addEventListener('authLogout', () => {
// Redirect or show login
});
`
`javascript
// Set custom timeout (in milliseconds)
window.universalWalletAuth.sessionTimeout = 2 60 60 * 1000; // 2 hours
window.universalWalletAuth.inactivityTimeout = 15 60 1000; // 15 minutes
`
`javascript
const session = window.universalWalletAuth.loadSession();
if (window.universalWalletAuth.isSessionValid(session)) {
} else {
}
`
Enable detailed logging:
`javascript
// Check auth status
);
);
);
, 'minutes');
`
`html
`1. Signature Verification: Every session requires cryptographic signature 2. No Transaction Risk: Signature does NOT authorize any blockchain transactions 3. Session Tokens: Generated from wallet address + signature + timestamp 4. Auto-Logout: Sessions expire after 4 hours or 30 minutes of inactivity 5. Wallet Changes: Auto-logout if user switches wallet or network
1. ✅ Always include scripts in correct order
2. ✅ Use requireAuth for protected pages
3. ✅ Handle authSuccess and authLogout events
4. ✅ Test session expiry flows
5. ✅ Provide clear UX for expired sessions
6. ✅ Show work time to contractors for transparency