Merge pull request #911 from Tzahi12345/registration-fixes

Registration fixes
pull/917/head
Tzahi12345 2 years ago committed by GitHub
commit ab5d8dc5ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2742,7 +2742,7 @@ components:
error:
type: string
schedule:
type: object
$ref: '#/components/schemas/Schedule'
options:
type: object
Schedule:
@ -2877,6 +2877,7 @@ components:
- sharing
- advanced_download
- downloads_manager
- tasks_manager
YesNo:
type: string
enum:

@ -68,15 +68,7 @@ exports.initialize = function () {
const setupRoles = async () => {
const required_roles = {
admin: {
permissions: [
'filemanager',
'settings',
'subscriptions',
'sharing',
'advanced_download',
'downloads_manager',
'tasks_manager'
]
permissions: consts.AVAILABLE_PERMISSIONS
},
user: {
permissions: [

@ -3,5 +3,5 @@
/* eslint-disable */
export type Config = {
YoutubeDLMaterial: any;
YoutubeDLMaterial: Record<string, any>;
};

@ -26,5 +26,5 @@ export type Download = {
user_uid?: string;
sub_id?: string;
sub_name?: string;
prefetched_info?: any;
prefetched_info?: Record<string, any>;
};

@ -5,6 +5,6 @@
export type GetFileFormatsResponse = {
success: boolean;
result: {
formats?: Array<any>;
formats?: Array<Record<string, any>>;
};
};

@ -6,5 +6,5 @@ import type { Subscription } from './Subscription';
export type GetSubscriptionResponse = {
subscription: Subscription;
files: Array<any>;
files: Array<Record<string, any>>;
};

@ -11,6 +11,6 @@ export type Notification = {
user_uid?: string;
action?: Array<NotificationAction>;
read: boolean;
data?: any;
data?: Record<string, any>;
timestamp: number;
};

@ -15,5 +15,5 @@ export type Subscription = {
timerange?: string;
custom_args?: string;
custom_output?: string;
videos: Array<any>;
videos: Array<Record<string, any>>;
};

@ -2,6 +2,8 @@
/* tslint:disable */
/* eslint-disable */
import type { Schedule } from './Schedule';
export type Task = {
key: string;
title?: string;
@ -9,8 +11,8 @@ export type Task = {
last_confirmed: number;
running: boolean;
confirming: boolean;
data: any;
data: Record<string, any>;
error: string;
schedule: any;
options?: any;
schedule: Schedule;
options?: Record<string, any>;
};

@ -10,5 +10,5 @@ export type UpdateFileRequest = {
/**
* Object with fields to update as keys and their new values
*/
change_obj: any;
change_obj: Record<string, any>;
};

@ -4,5 +4,5 @@
export type UpdateTaskDataRequest = {
task_key: string;
new_data: any;
new_data: Record<string, any>;
};

@ -4,5 +4,5 @@
export type UpdateTaskOptionsRequest = {
task_key: string;
new_options: any;
new_options: Record<string, any>;
};

@ -9,4 +9,5 @@ export enum UserPermission {
SHARING = 'sharing',
ADVANCED_DOWNLOAD = 'advanced_download',
DOWNLOADS_MANAGER = 'downloads_manager',
TASKS_MANAGER = 'tasks_manager',
}

@ -84,8 +84,8 @@ export class AppComponent implements OnInit, AfterViewInit {
this.postsService.open_create_default_admin_dialog.subscribe(open => {
if (open) {
const dialogRef = this.dialog.open(SetDefaultAdminDialogComponent);
dialogRef.afterClosed().subscribe(success => {
if (success) {
dialogRef.afterClosed().subscribe(res => {
if (!res || !res['user']) {
if (this.router.url !== '/login') { this.router.navigate(['/login']); }
} else {
console.error('Failed to create default admin account. See logs for details.');

@ -734,7 +734,7 @@ export class PostsService implements CanActivate {
this.afterLogin(res['user'], res['token'], res['permissions'], res['available_permissions']);
}
}, err => {
if (err.status === 401) {
if (err === 'Unauthorized') {
this.sendToLogin();
this.token = null;
this.resetHttpParams();

Loading…
Cancel
Save