# normalizeGrant

**Kind:** Function

**Source:** [`atloria-monorepo/packages/ui-core/src/components/api-explorer/oauth2.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/packages/ui-core/src/components/api-explorer/oauth2.ts#L539)

Turn a token response into what we keep.

RFC 6749 §5.1: an omitted `scope` means the grant matches what was requested — so the
requested scopes are recorded rather than leaving the reader with a token of unknown reach.
`refresh_token` is read and DROPPED here, in one place, so no caller can accidentally persist
a credential that outlives the tab.

## Signature

```ts
function normalizeGrant(schemeId: string, raw: Record<string, unknown>, requestedScopes: string[], now): OAuth2Grant
```

## Parameters

| Name | Type |
|---|---|
| `schemeId` | `string` |
| `raw` | `Record<string, unknown>` |
| `requestedScopes` | `string[]` |
| `now` | `any` |

**Returns:** `OAuth2Grant`
