Public/Disconnect-OnePAM.ps1

function Disconnect-OnePAM {
    <#
    .SYNOPSIS
        Logs out of OnePAM by removing cached credentials.
    .DESCRIPTION
        Removes the cached OAuth2 token from ~/.onepam/token.json.
    .EXAMPLE
        Disconnect-OnePAM
    #>

    [CmdletBinding()]
    param()

    $token = Get-OpToken
    if (-not $token) {
        Write-Host 'Not currently authenticated.' -ForegroundColor Yellow
        return
    }

    Remove-OpToken
    Write-Host 'Logged out successfully.' -ForegroundColor Green
}