Galantis uses three distinct authentication mechanisms: Shopify OAuth for store access, Meta OAuth for WhatsApp Business Account access, and Inertia.js session-based authentication for the merchant dashboard. Each mechanism is scoped to a specific integration or access path and stores credentials encrypted per tenant.Documentation Index
Fetch the complete documentation index at: https://docs.digifist.com/llms.txt
Use this file to discover all available pages before exploring further.
What this covers
- Shopify OAuth token exchange and usage
- Meta OAuth token exchange, storage, and scope
- Internal dashboard session authentication
- Multi-tenant credential isolation
- Token security model
Shopify OAuth
Token exchange
Shopify authentication is initiated during app installation. The process usesShopifyTokenExchangeService:
Usage
All Shopify Admin API calls are made byShopifySdkService using the tenant’s encrypted access token. ShopifySdkService handles:
- Customer data fetching and webhook subscription management
- Order data retrieval for automation context
- Abandoned checkout polling via the Shopify Admin GraphQL API
- App subscription management for billing
ShopifySdkService resolves the correct tenant’s access token from the encrypted store and injects it into every API request. No access token is ever passed in application-level code — ShopifySdkService abstracts the credential management entirely.
Token lifecycle
| Event | Effect on token |
|---|---|
| App installed | Token issued and stored encrypted |
| App uninstalled | app/uninstalled webhook received; tenant deactivated; token no longer used |
| Token manually revoked in Shopify | API calls begin failing; requires reinstallation to restore |
| Shopify store plan change | Token typically unaffected — scope changes only occur on permission re-grant |
Meta OAuth
Token exchange
Meta authentication is initiated from within the Galantis dashboard when a merchant connects their WhatsApp Business Account. The process usesWhatsappConnectionController:
Token scope and usage
The Meta access token grants Galantis access to:- The WhatsApp Business Account’s registered phone numbers
- The Message API for sending messages via the selected phone number
- The Template API for creating, submitting, and reading template status
- The Media Upload API for uploading template header assets
- Reading from and writing to the merchant’s Meta Catalog via the Catalog API
MetaGraphClient, which resolves and injects the correct tenant’s encrypted token per request.
Token expiry
Unlike Shopify tokens, Meta access tokens are subject to expiry. Long-lived tokens have a defined validity window. They can also be revoked if the authorizing Meta user changes their credentials or revokes the app authorization in Meta’s settings. When a Meta token expires or is revoked:- All Meta API calls for that tenant fail
- Messages stop sending
- Template status stops updating
- Catalog sync fails (if the catalog token is affected)
Multiple phone numbers
When a workspace has multiple phone numbers, each number is associated with the same WABA access token — the token is scoped to the WABA, not to individual phone numbers. API calls specify thephone_id in the endpoint path to route messages through the correct number.
Internal dashboard authentication
The Galantis merchant dashboard uses Inertia.js with session-based authentication. Agents and team members authenticate with email and password credentials. Sessions are managed server-side by Laravel’s session system. Multi-tenant routing resolves the correct tenant workspace from the request context (subdomain or request header) before session authentication runs. A valid session in Tenant A does not grant access to Tenant B — tenant isolation is enforced at the database layer before any application logic evaluates permissions. Role-based access control is enforced by Spatie Laravel Permission. Every authenticated request is validated against the user’s role and the specific permission required for the requested action (TenantPermissionsEnum). See Inbox — Roles & Permissions for the role and permission reference.
Token security model
All access tokens — Shopify and Meta — are stored encrypted in the per-tenant PostgreSQL schema. The encryption uses application-level encryption rather than database-level encryption, meaning tokens are encrypted before being written to the database and decrypted only when needed for API calls. Key security properties:- No access token is logged in plaintext in application logs
- No access token is returned in API responses to the merchant dashboard — credentials are write-only from the merchant’s perspective
- Tenant schema isolation means a compromised query in one tenant’s context cannot read another tenant’s tokens
ShopifySdkServiceandMetaGraphClientare the only application components that decrypt and use tokens — the decryption is not accessible from merchant-facing code paths
Related guides
- Architecture — Multi-tenant model and how tenant context is resolved
- Integrations — Shopify — Shopify integration context for the OAuth flow
- Integrations — Connecting WABA — Meta OAuth flow from the merchant perspective