Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ export class TwitchLoginComponent {
@Input() redirectUrl: string | null = null;

twitchLogin(): void {
const redirectUrl = `${environment.apiUrl}/${this.redirectUrl}`;
window.location.href = `https://id.twitch.tv/oauth2/authorize?` +
encodeURI(`client_id=${environment.twitchClientId}&` +
`redirect_uri=${redirectUrl}&` +
`redirect_uri=${this.redirectUrl}&` +
`response_type=code&` +
`scope=${environment.twitchScopes[this.twitchScopeIndex].join(' ')}`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/src/app/view/login/login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
data-shape="rectangular"
data-logo_alignment="left">
</div>
<app-twitch-login [twitchScopeIndex]="0" redirectUrl="user/twitch-login" />
<app-twitch-login [twitchScopeIndex]="0" [redirectUrl]="environment.apiUrl + '/user/twitch-login'" />
</div>
<div class="centered-box_content-container" [hidden]="!checkingLogin">
<app-loading-icon fontSize="24px" height="35px" width="35px">
Expand Down
2 changes: 2 additions & 0 deletions src/src/app/view/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,6 @@ export class LoginComponent implements OnInit {
}
});
}

protected readonly environment = environment;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<app-standard-banner/>

<app-twitch-login [twitchScopeIndex]="1" redirectUrl="twitchbot/login"/>
<app-twitch-login [twitchScopeIndex]="1" [redirectUrl]="environment.twitchBotApiUrl + '/login'"/>

<app-twitch-bot-faq/>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {MatButton} from '@angular/material/button';
import {StandardBannerComponent} from '../../../common/components/standard-banner/standard-banner.component';
import {TwitchLoginComponent} from '../../../common/components/twitch-login/twitch-login.component';
import {TwitchBotFaqComponent} from "../twitch-bot-faq/twitch-bot-faq.component";
import {environment} from "../../../../environments/environment";

@Component({
selector: 'app-twitch-bot-index',
Expand All @@ -21,4 +22,5 @@ import {TwitchBotFaqComponent} from "../twitch-bot-faq/twitch-bot-faq.component"
styleUrl: './twitch-bot-index.component.scss'
})
export class TwitchBotIndexComponent {
protected readonly environment = environment;
}