01. G6 MW Authentication
Authentication
Overview
Authentication Flow
Step 1: Get Challenge
const response = await fetch(`${apiUrl}/auth/challenge`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
public_address: g6_address // SS58-355 encoded address
})
})
const data = await response.json()Step 2: Sign Challenge
Step 3: Verify Signature
Step 4: Verify Authentication Status
Faucet
Route Guards
Complete Authentication Hook
Axios Configuration
Security Best Practices
JWT Token Management
Common Issues
"Authentication failed"
"CORS error"
Address Encoding
Next Steps
Last updated
Was this helpful?