# `MishkaCmsCore.Accounts.Changes.DebugTokenGeneration`
[🔗](https://github.com/mishka-group/mishka_cms_core/blob/v0.0.1/lib/mishka_cms_core/accounts/__changes/debug.ex#L5)

Debug change for troubleshooting token generation and tenant issues.

This change provides detailed logging throughout the token generation process,
particularly focusing on tenant handling and context management. It logs the
changeset state before and after token generation, attempts to clear tenant
information for proper token creation, and tracks the user creation lifecycle.

The change attempts to resolve tenant-related issues by clearing the tenant from
multiple locations in the changeset and setting authentication-specific context
flags. It uses after_action callbacks to log the final state of created users,
helping identify where tenant information might be incorrectly retained.

This module should only be used during development and debugging. It exposes
sensitive information through logs and should be removed or disabled in production
environments. The extensive logging helps trace authentication flow issues and
tenant isolation problems in multi-tenant authentication scenarios.

# `change`

Applies debug logging and tenant manipulation to the changeset.

Logs changeset state at multiple points, attempts to clear tenant information,
and tracks the user creation process through after_action callbacks.

## Parameters
- `changeset` - The Ash changeset being modified
- `_opts` - Change options (unused)
- `_context` - Change context (unused)

## Returns
Modified changeset with debug logging and tenant clearing attempts

---

*Consult [api-reference.md](api-reference.md) for complete listing*
