Repository navigation
Add AIOStreams, TorBox and dual-debrid stream diversity #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module Admin | ||
| class SettingsController < ApplicationController | ||
| before_action :authenticate_user! | ||
| before_action :require_admin! | ||
|
|
||
| def show | ||
| @settings = AppSetting.current | ||
| end | ||
|
|
||
| def update | ||
| @settings = AppSetting.current | ||
| attributes = settings_params.to_h.compact_blank | ||
| # Blank fields keep the current team key. | ||
| if @settings.update(attributes) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verify a replacement team key before saving it. If an administrator mistypes a team key, this update replaces the working key without testing the replacement. Every account that depends on that team key then receives the invalid credential. Verify each submitted key before replacing the stored value, and show a failure without changing the working key.
|
||
| redirect_to admin_settings_path, notice: "Team settings updated." | ||
| else | ||
| render :show, status: :unprocessable_entity | ||
| end | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def settings_params | ||
| params.require(:app_setting).permit(:realdebrid_api_key, :torbox_api_key) | ||
| end | ||
| end | ||
| end | ||
Uh oh!
There was an error while loading. Please reload this page.