Public/Authentication/Disconnect-FloRecruit.ps1

function Disconnect-FloRecruit {
    <#
    .SYNOPSIS
        Disconnects from the FloRecruit API and clears the session.

    .DESCRIPTION
        Clears the current FloRecruit session, removing all stored credentials and tokens from memory.

    .EXAMPLE
        Disconnect-FloRecruit

    .NOTES
        Always call this when done with the API to clear sensitive data from memory.
    #>

    [CmdletBinding()]
    param()

    if ($Script:FloRecruitSession) {
        $email = $Script:FloRecruitSession.Email
        $Script:FloRecruitSession = $null
        Write-Host "Disconnected from FloRecruit (was connected as $email)" -ForegroundColor Yellow
        Write-Verbose "Session cleared"
    }
    else {
        Write-Verbose "No active session to disconnect"
    }
}