realvco Docs

How Magic Token Works

What Is a Magic Token?

Magic Token is the simplified sign-in mechanism for realvco’s mVPS. Traditional passwords force you to memorize strings; Magic Token lets you sign in by clicking one link.

Mechanics

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│   Email     │────>│  Magic Link │────>│  Auto       │
│   link      │     │ (with token)│     │  sign-in    │
└─────────────┘     └─────────────┘     └─────────────┘

Clicking a Magic Link triggers:

  1. Browser opens the link — URL contains a one-time or short-lived token
  2. System verifies the token — checks validity and expiry
  3. Session created — signs in and stores credentials in localStorage
  4. Subsequent auto sign-in — so long as the token is valid, reopening the page signs you in automatically

Token Types

realvco uses two tokens:

TokenPurposeLifetime
Magic Link TokenFirst-time sign-in24 hours
Session TokenPersistent signed-in state30 days
  • Arrives in the welcome email
  • Embedded in the Admin Panel and AI companion URLs
  • Single-use — invalidated after consumption
  • Expires after 24 hours

Session Token

  • Stored in the browser after a successful sign-in
  • Reopening the URL signs in automatically
  • Expires after 30 days of inactivity
  • Clearing browser data requires a new Magic Link

Security Considerations

Why Is Magic Token Secure?

“Sign in with one click” sounds risky, but there are layers of protection:

MechanismDescription
HTTPSEvery link uses HTTPS; tokens are encrypted in transit
Unpredictable tokensCryptographically random; cannot be guessed
Short lifetimeMagic Links auto-expire after 24 hours
Single-useConsumed tokens are invalidated
IP scopingTokens are bound to the first-use IP range to limit theft

Important:

  • Do not share your Magic Link with anyone you do not fully trust
  • Do not post publicly (forums, GitHub, social media)
  • Review sign-in history periodically in the Admin Panel
  • If you suspect a leak, redeploy the container to issue a new token

FAQ

Two options:

  1. Copy it from the Admin Panel: once signed in, copy each companion’s Magic Link
  2. Contact support: with proof of purchase, the welcome email can be resent

Q: Can I Use It on Multiple Devices?

Yes. A Magic Link works across devices — each establishes an independent Session Token.

Q: What if I Clear My Browser Data?

You’ll need the original Magic Link again. Store the welcome email somewhere safe.

Q: How Do I Sign Out?

There is no explicit sign-out today. For a forced sign-out:

  1. Clear browser localStorage, or
  2. Redeploy the container (new token; old ones are invalidated)

Technical Details (for the Curious)

Tokens use the JWT (JSON Web Token) format:

Header: { "alg": "HS256", "typ": "JWT" }
Payload: {
  "sub": "container_id",
  "iat": 1234567890,
  "exp": 1234654290,
  "role": "admin"
}
Signature: HMACSHA256(base64(header) + "." + base64(payload), secret)

The token is verified on the host — it cannot be forged.