Skip to content

Commit 20cb165

Browse files
Simplifying login
1 parent ec1d34c commit 20cb165

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

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

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

2222
twitchLogin(): void {
23-
let redirectUrl = null;
24-
if (!this.redirectUrl) {
25-
redirectUrl = `${environment.apiUrl}/user/twitch-login`;
26-
} else {
27-
redirectUrl = `${environment.apiUrl}/${this.redirectUrl}`;
28-
}
29-
23+
const redirectUrl = `${environment.apiUrl}/${this.redirectUrl}`;
3024
window.location.href = `https://id.twitch.tv/oauth2/authorize?` +
3125
encodeURI(`client_id=${environment.twitchClientId}&` +
3226
`redirect_uri=${redirectUrl}&` +

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" />
19+
<app-twitch-login [twitchScopeIndex]="0" redirectUrl="user/twitch-login" />
2020
</div>
2121
<div class="centered-box_content-container" [hidden]="!checkingLogin">
2222
<app-loading-icon fontSize="24px" height="35px" width="35px">

0 commit comments

Comments
 (0)