-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from ZusorCode/twitch-scope-selector
Add twitch scope selector
- Loading branch information
Showing
4 changed files
with
66 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
website/src/components/website/TwitchAuthScopeSelector.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<div class="container"> | ||
<h1>Give our systems access to a twitch account</h1> | ||
<b-form-group label="Enabled features" v-slot="{ ariaDescribedby }"> | ||
<b-form-checkbox-group | ||
id="checkbox-group-1" | ||
v-model="selected" | ||
:options="options" | ||
:aria-describedby="ariaDescribedby" | ||
stacked | ||
></b-form-checkbox-group> | ||
</b-form-group> | ||
|
||
<a :href="twitchAuthURL" class="btn btn-dark" :class="{'disabled': selected.length === 0}">Authorize</a> | ||
|
||
</div> | ||
</template> | ||
|
||
<script> | ||
import { BFormCheckboxGroup, BFormGroup } from "bootstrap-vue"; | ||
export default { | ||
name: "TwitchAuthScopeSelector", | ||
components: { | ||
BFormGroup, | ||
BFormCheckboxGroup | ||
}, | ||
data: () => ({ | ||
selected: [], // Must be an array reference! | ||
options: [ | ||
{ | ||
text: "Predictions (channel:manage:predictions channel:read:predictions)", | ||
value: "channel:manage:predictions channel:read:predictions" | ||
}, | ||
{ | ||
text: "Title/Game (channel:manage:broadcast)", | ||
value: "channel:manage:broadcast" | ||
}, | ||
{ | ||
text: "Ads (channel:edit:commercial)", | ||
value: "channel:edit:commercial" | ||
} | ||
] | ||
}), | ||
computed: { | ||
twitchAuthURL() { | ||
return `${process.env.VUE_APP_DATA_SERVER}/twitch_auth/${this.selected.join(" ")}`; | ||
} | ||
} | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters