• Parse a User Profile based on a JWT payload. Will return undefined if not a valid JWT payload

    Example

    import jwtDecode from 'jwt-decode'

    const jwtPayload = jwtDecode('a valid token from a user')
    const userProfile = userService.parseUserProfile(jwtPayload)
    if (userProfile) {
    // continue
    }

    Parameters

    • data: unknown

      An object containing all parameters to be passed to the function

    Returns UserProfile | undefined