Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandawg93 committed Jul 20, 2022
2 parents 7d63056 + 6d7f615 commit d757748
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/nest/streamer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ enum StreamQuality {
* @returns {string} The random device id
*/
const generateDeviceId = (): string => {
return 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.replace('x', () => {
return 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.replace(/x/g, () => {
return Math.floor(Math.random() * 16).toString(16);
});
};
Expand Down Expand Up @@ -276,9 +276,14 @@ export class NexusStreamer {
* Update the socket authentication with the new access token
*/
private updateAuthentication(): void {
const token = {
olive_token: this.accessToken,
};
var token = {};
if (this.nestAuth) {
// Re-authorisation using "Nest" token
token = {session_token: this.accessToken};
} else {
// Re-authorisation using "Google" token
token = {olive_token: this.accessToken};
}
const tokenContainer = new Pbf();
AuthorizeRequest.write(token, tokenContainer);
const tokenBuffer = tokenContainer.finish();
Expand Down

0 comments on commit d757748

Please sign in to comment.