|
107 | 107 | </div>
|
108 | 108 | </div>
|
109 | 109 | </div>
|
| 110 | + |
| 111 | + <template v-if="'plex' === backend.type"> |
| 112 | + <label class="label">User PIN</label> |
| 113 | + <div class="control has-icons-left"> |
| 114 | + <input class="input" type="text" v-model="backend.options.PLEX_USER_PIN" :disabled="stage > 1"> |
| 115 | + <div class="icon is-left"><i class="fas fa-key"></i></div> |
| 116 | + <p class="help"> |
| 117 | + If the user you going to select is using <code>PIN</code> to login, enter the PIN here. |
| 118 | + </p> |
| 119 | + </div> |
| 120 | + </template> |
110 | 121 | </template>
|
111 | 122 |
|
112 | 123 | <template v-if="stage>=1">
|
|
175 | 186 | <NuxtLink @click="getUsers" v-text="'Retrieve User ids from backend.'" v-if="stage < 4"/>
|
176 | 187 | </p>
|
177 | 188 | </div>
|
178 |
| - <template v-if="'plex' === backend.type"> |
179 |
| - <label class="label">User PIN</label> |
180 |
| - <div class="control has-icons-left"> |
181 |
| - <input class="input" type="text" v-model="backend.options.PLEX_USER_PIN" :disabled="stage > 3"> |
182 |
| - <div class="icon is-left"><i class="fas fa-key"></i></div> |
183 |
| - <p class="help"> |
184 |
| - If the selected user is using <code>PIN</code> to login, enter the PIN here. |
185 |
| - </p> |
186 |
| - </div> |
187 |
| - </template> |
188 | 189 | </div>
|
189 | 190 |
|
190 | 191 | <template v-if="stage >= 4">
|
@@ -488,6 +489,12 @@ const getUsers = async (showAlert = true) => {
|
488 | 489 | }
|
489 | 490 | }
|
490 | 491 |
|
| 492 | + if (backend.value.options && backend.value.options.PLEX_USER_PIN) { |
| 493 | + data.options = { |
| 494 | + PLEX_USER_PIN: backend.value.options.PLEX_USER_PIN |
| 495 | + } |
| 496 | + } |
| 497 | +
|
491 | 498 | const response = await request(`/backends/users/${backend.value.type}?tokens=1`, {
|
492 | 499 | method: 'POST',
|
493 | 500 | body: JSON.stringify(data)
|
@@ -614,7 +621,7 @@ const addBackend = async () => {
|
614 | 621 |
|
615 | 622 | if ('plex' === backend.value.type) {
|
616 | 623 | let token = users.value.find(u => u.id === backend.value.user).token
|
617 |
| - if (token !== backend.value.token) { |
| 624 | + if (token && token !== backend.value.token) { |
618 | 625 | backend.value.options.ADMIN_TOKEN = backend.value.token;
|
619 | 626 | backend.value.token = token
|
620 | 627 | }
|
|
0 commit comments