Skip to content

Commit 254ad8a

Browse files
Re-pointing the twitch bot login to the twitch bot api
1 parent 9f872c4 commit 254ad8a

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

src/src/app/common/components/twitch-login/twitch-login.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ export class TwitchLoginComponent {
2020
@Input() redirectUrl: string | null = null;
2121

2222
twitchLogin(): void {
23-
const redirectUrl = `${environment.apiUrl}/${this.redirectUrl}`;
2423
window.location.href = `https://id.twitch.tv/oauth2/authorize?` +
2524
encodeURI(`client_id=${environment.twitchClientId}&` +
26-
`redirect_uri=${redirectUrl}&` +
25+
`redirect_uri=${this.redirectUrl}&` +
2726
`response_type=code&` +
2827
`scope=${environment.twitchScopes[this.twitchScopeIndex].join(' ')}`);
2928
}

src/src/app/view/login/login.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
data-shape="rectangular"
1717
data-logo_alignment="left">
1818
</div>
19-
<app-twitch-login [twitchScopeIndex]="0" redirectUrl="user/twitch-login" />
19+
<app-twitch-login [twitchScopeIndex]="0" [redirectUrl]="environment.apiUrl + '/user/twitch-login'" />
2020
</div>
2121
<div class="centered-box_content-container" [hidden]="!checkingLogin">
2222
<app-loading-icon fontSize="24px" height="35px" width="35px">

src/src/app/view/login/login.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,6 @@ export class LoginComponent implements OnInit {
5959
}
6060
});
6161
}
62+
63+
protected readonly environment = environment;
6264
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<app-standard-banner/>
22

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

55
<app-twitch-bot-faq/>

src/src/app/view/twitch/twitch-bot-index/twitch-bot-index.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {MatButton} from '@angular/material/button';
55
import {StandardBannerComponent} from '../../../common/components/standard-banner/standard-banner.component';
66
import {TwitchLoginComponent} from '../../../common/components/twitch-login/twitch-login.component';
77
import {TwitchBotFaqComponent} from "../twitch-bot-faq/twitch-bot-faq.component";
8+
import {environment} from "../../../../environments/environment";
89

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

0 commit comments

Comments
 (0)