Tags: XQ-Message-Inc/jssdk-core
Tags
rm adding 'active profile' until final phase of auth process Problem We currently add a user's 'active profile' to the in-memory cache to keep track of as soon as the user utilizes the `Authorize` service. This is unneeded until they are fully authenticated. Solution Remove the adding of the 'active profile' until the final phase of the authorization process, `ExchangeForAccessToken`. After the code validation process is complete via the `CodeValidator` service we utilize `ExchangeForAccessToken` to exchange the pre-auth token for a full auth token. We then add the 'active profile' of the user which is simply taken for the decoded access token (a JWT) Result We do not add an 'active profile' until a user is fully authenticated
Merge pull request #5 from XQ-Message-Inc/updates Problem * We need a service for the dashboard `/session` endpoint, which it utilized to validate a given XQ Dashboard session. * Due to [typescript `v.4.4`](https://devblogs.microsoft.com/typescript/announcing-typescript-4-4/) updates, which include a [defaulting to the unknown Type in Catch Variables](https://devblogs.microsoft.com/typescript/announcing-typescript-4-4/) update. Solution * add `ValidateSession` service in `/dashboard` * add `handleException` function and use for `ServerResponse.ERROR` cases and as catch block default method for each service Result * user may now import `ValidateSession` from `@xqmsg/jssdk-core` and use to it validate a user's dashboard session. Returns a `204` if validated as active. * all errors return as a `ServerResponse`, either by a returned `ServerResponse.ERROR` from the XQ API, or falling back to a default `ServerResponse.ERROR`