MCPcopy Create free account
hub / github.com/ampproject/amphtml / parseUserData

Function parseUserData

third_party/subscriptions-project/swg.js:6213–6220  ·  view source on GitHub ↗

* @param {!Object} swgData * @return {?UserData} * @package Visible for testing.

(swgData)

Source from the content-addressed store, hash-verified

6211 * @package Visible for testing.
6212 */
6213function parseUserData(swgData) {
6214 const idToken = swgData['idToken'];
6215 if (!idToken) {
6216 return null;
6217 }
6218 const jwt = /** @type {!Object} */ (new JwtHelper().decode(idToken));
6219 return new UserData(idToken, jwt);
6220}
6221
6222/**
6223 * @param {!./deps.DepsDef} deps

Callers 1

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected