2.4 KiB
2.4 KiB
Auth Login Fix ✅
Problem
When trying to login, got error: "Unknown method: auth.login"
Root Cause
The auth.login method was defined in the code, but the config field was prefixed with _ (marking it unused), which prevented the auth logic from accessing dev_mode settings.
Fix Applied
File: core/archipelago/src/api/rpc.rs
Changed:
pub struct RpcHandler {
_config: Config, // ❌ Marked as unused
...
}
To:
pub struct RpcHandler {
config: Config, // ✅ Now accessible
...
}
This allows the auth handler to check if we're in dev mode and accept the default password.
How Auth Works Now
Dev Mode (default)
- Password:
password123 - No setup required
- Works immediately for development
Production Mode
- Requires user setup first
- Uses bcrypt password hashing
- Stored in data directory
Rebuild & Test
cd /Users/dorian/Projects/archy
# 1. Rebuild backend
./clean-rebuild.sh
# 2. Start dev server
./scripts/dev-start.sh
Choose option 2 (Full stack)
Login
Password: password123
Should log you in successfully! 🎉
Available RPC Methods
The backend now supports:
Auth:
auth.login- Login with passwordauth.logout- Logout
Containers:
container-install- Install a containercontainer-start- Start a containercontainer-stop- Stop a containercontainer-remove- Remove a containercontainer-list- List all containerscontainer-status- Get container statuscontainer-logs- Get container logscontainer-health- Get health status
Packages:
package.start- Start docker-compose apppackage.stop- Stop docker-compose apppackage.restart- Restart docker-compose app
Testing:
echoorserver.echo- Echo back message
Testing Auth
You can test the auth endpoint directly:
curl -X POST http://localhost:5959/rpc/v1 \
-H "Content-Type: application/json" \
-d '{
"method": "auth.login",
"params": {
"password": "password123"
}
}'
Expected response:
{
"result": null,
"error": null
}
Next Steps
Now that auth is working, you can:
- Navigate the UI - All routes should work
- Install containers - Try installing Bitcoin Core or Lightning
- Manage apps - Start/stop containerized services
- View logs - Monitor container output
Auth is now fully functional! 🔐