Overview
Crocante uses a secure session-based authentication system with HttpOnly cookies managed by the backend-for-frontend (BFF) architecture. This guide covers logging in, registering new accounts, and managing session expiry.Logging In
Access the Login Modal
When you first visit Crocante or when your session expires, you’ll be prompted with the login modal.Enter Your Credentials
Provide your username and password in the login form. The platform uses the
useLogin hook from services/hooks/mutations/use-login to authenticate your credentials.Submit Login
Click the Log in button to authenticate. Your credentials are securely sent to the backend, and an HttpOnly session cookie is created upon successful authentication.
The session is managed entirely through HttpOnly cookies, which cannot be accessed by JavaScript, providing enhanced security against XSS attacks.
Registering a New Account
Multi-Step Registration Process
Crocante requires a comprehensive KYC (Know Your Customer) process for compliance. The registration involves 5 steps:Create Account
Click Register new account from the login modal. Enter your desired username, email, and password in the account creation form.
Verify Email (OTP)
After submitting your account details, you’ll receive a one-time password (OTP) via email. Enter the OTP code to verify your email address.
If you don’t receive the OTP, you can click Resend to request a new code.
Personal Information
Provide your personal details including:
- Full legal name
- Date of birth
- Residential address
- Phone number
- Nationality
Assets Origin
Declare the origin of your assets and confirm whether you are a politically exposed person (PEP). This information is required for regulatory compliance.
KYC Documents
Upload the required KYC documents:
- Government-issued ID (passport, driver’s license, or national ID)
- Proof of address (utility bill, bank statement, or lease agreement)
- Selfie with ID (for identity verification)
Session Management
Session Expiry Warning
Crocante automatically monitors your session using theSessionExpiryManager component and useSessionExpiry hook located in:
context/session-expiry-manager.tsxhooks/use-session-expiry.ts
Automatic Monitoring
When you’re signed in, the platform continuously monitors your session expiration time by checking
/api/auth/session.Expiry Warning
30 seconds before your session expires, a modal appears showing a countdown timer and the remaining time.
Renew Session
Click Renew session to extend your session without losing your work. The platform sends a request to
/api/auth/renew to refresh your session cookie.Session Provider Context
TheSessionProvider component (context/session-provider.tsx) manages your authentication state throughout the application:
- User Data Polling: Automatically polls
/api/user/meat regular intervals to keep user data fresh - Auth Expired Events: Listens for
auth-expiredbrowser events to handle session termination - Automatic Logout: Clears local storage and query cache when sessions expire
The
useSession() hook provides access to:isSignedIn: Boolean indicating authentication statususer: Current user object with profile dataisLoading: Loading state during authentication checkslogout(): Function to manually log out
Best Practices
Keep Sessions Active
If you’re actively working, click Renew session when prompted to avoid losing unsaved work.
Secure Logout
Always log out when using shared or public computers to protect your account.
Strong Passwords
Use unique, complex passwords with a combination of letters, numbers, and symbols.
Verify Email
Ensure your email address is up to date to receive OTP codes and important notifications.
Troubleshooting
Can’t Log In
- Verify your username and password are correct (passwords are case-sensitive)
- Check if your account has been approved after registration
- Try clearing your browser cache and cookies
Not Receiving OTP
- Check your spam/junk folder
- Verify the email address you provided during registration
- Use the Resend button to request a new OTP code
- Contact support if issues persist
Session Keeps Expiring
- Check your internet connection stability
- Ensure cookies are enabled in your browser
- Disable browser extensions that might interfere with cookies
- Try using a different browser
Related Resources
Managing Assets
Learn how to view and manage your digital asset portfolio
Deposit & Withdrawal
Fund your account and withdraw assets
