(wire: Partial<TokenInfoWire>)
| 76 | } |
| 77 | |
| 78 | export function tokenFromWire(wire: Partial<TokenInfoWire>): TokenInfo { |
| 79 | return { |
| 80 | accessToken: wire.access_token ?? '', |
| 81 | refreshToken: wire.refresh_token ?? '', |
| 82 | expiresAt: typeof wire.expires_at === 'number' ? wire.expires_at : 0, |
| 83 | scope: wire.scope ?? '', |
| 84 | tokenType: wire.token_type ?? '', |
| 85 | expiresIn: typeof wire.expires_in === 'number' ? wire.expires_in : 0, |
| 86 | }; |
| 87 | } |