Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.159
Cant Read [ /etc/named.conf ]
8.1.31
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
edu-lms /
app /
containers /
auth /
store /
[ HOME SHELL ]
Name
Size
Permission
Action
actions.ts
1.49
KB
-rw-r--r--
constant.ts
1.41
KB
-rw-r--r--
reducer.ts
1.49
KB
-rw-r--r--
saga.ts
7.58
KB
-rw-r--r--
service.ts
4.95
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : saga.ts
/* eslint-disable */ import { AjaxError } from 'helpers/ajax'; import { push } from 'connected-react-router'; import { call, put,delay, takeLatest } from 'redux-saga/effects'; import { actions as globalActions } from 'service/global'; import storage from 'helpers/storage'; import { Types } from './constant'; import { LoginData, AccountData, TokenInfo, UserInfo, AuthState, } from './constant'; import { service } from './service'; import { actions } from './actions'; function* login(action) { try { // effects(call, put): // trigger off the code that we want to call that is asynchronous // and also dispatched the result from that asynchrous code. const loginData: LoginData = action.payload; yield put(globalActions.showLoading('Logging in...')); const tokenInfo: TokenInfo = yield call(service.login, { ...loginData, }); yield put(actions.loginSuccess(tokenInfo)); yield put(globalActions.hideLoading()); } catch (err) { yield put(globalActions.hideLoading()); if (err.status === 422) yield put(actions.failure(err)); else { if (err && err.data) yield put( globalActions.notifyError(`${err.data.message.error[0]}`), ); else yield put(globalActions.notifyError(`${err.data.message}`)); } } } function* loginAccount(action) { try { const loginAccountData = action.payload; yield put(globalActions.showLoading('Logging in...')); const getAccount = yield call(service.getAccount, { ...loginAccountData, }); const account_uuid=getAccount.data.data[0].uuid; const data={ user_id:loginAccountData.id, uuid:account_uuid, user_token:loginAccountData.user_token, } const response = yield call(service.loginAccount, {...data }); storage.set( Types.KEY_TOKEN,response.data.data.token ); storage.set(Types.ROLE, btoa(response.data.data.user_type)); storage.set(Types.LOGGED_USER, btoa(JSON.stringify(userInfoFormat(response.data.data)))); yield put(actions.loginAccountSuccess(userInfoFormat(response.data.data))); // console.log(userInfoFormat(response.data.data)) yield put(globalActions.hideLoading()); yield put(globalActions.notifySuccess(`${response.data.message}`)); yield put(push('/dashboard')); } catch (err) { yield put(globalActions.hideLoading()); if (err.response.status === 422) yield put(actions.failure(err.response)); else { if (err && err.response.data) yield put( globalActions.notifyError(`${err.response.data.message.error[0]}`), ); else yield put(globalActions.notifyError(`${err.response.data.message}`)); } } } function* selectRole(action) { try { const formData = action.payload; yield put(globalActions.showLoading()); const response = yield call(service.selectRole, { ...formData, }); yield put(actions.selectRoleSuccess(response)); yield put(globalActions.hideLoading()); } catch (err) { yield put(globalActions.hideLoading()); if (err.response.status === 422) yield put(actions.failure(err.response)); else { if (err && err.response.data) yield put( globalActions.notifyError(`${err.response.data.message.error[0]}`), ); else yield put(globalActions.notifyError(`${err.response.data.message}`)); } } } function* saveProfile(action) { try { const formData = action.payload; yield put(globalActions.showLoading()); const response = yield call(service.saveProfile, { ...formData, }); yield put(actions.saveProfileSuccess(response)); yield put(globalActions.hideLoading()); } catch (err) { yield put(globalActions.hideLoading()); if (err.response.status === 422) yield put(actions.failure(err.response)); else { if (err && err.response.data) yield put( globalActions.notifyError(`${err.response.data.message.error[0]}`), ); else yield put(globalActions.notifyError(`${err.response.data.message}`)); } } } function* logout() { yield put(globalActions.showLoading('Loging out...')); storage.remove(Types.KEY_TOKEN); storage.remove(Types.ROLE); storage.remove(Types.LOGGED_USER); yield put(globalActions.notifySuccess(`Logout successfully`)); yield put(globalActions.hideLoading()); } function* register(action) { try { const registerData = action.payload; yield put(globalActions.showLoading('Logging in...')); const registerInfo = yield call(service.register, { ...registerData, }); yield put(actions.registerSuccess(registerInfo)); yield put(globalActions.hideLoading()); yield put(push('/login')); } catch (err) { yield put(globalActions.hideLoading()); if (err.status === 422) yield put(actions.failure(err)); else { if (err && err.data) yield put( globalActions.notifyError(`${err.data.message.error[0]}`), ); else yield put(globalActions.notifyError(`${err.data.message}`)); } } } function userInfoFormat (response:any) { let data={ id:response.id, uuid:response.uuid, first_name:response.firstname, last_name:response.lastname, full_name:response.full_name, email:response.email, role:response.role, account_user_id:response.account_user.id, token:response.token } if(response.user_type === 'student'){ let general_info= {}; if(response.account_user.resource_student){ general_info = { resource_student_id:response.account_user.resource_student.id, general_info:{ batch_id:response.account_user.resource_student.resource_category.parent_rec.parent_rec.id, batch_code:response.account_user.resource_student.resource_category.parent_rec.parent_rec.code, batch_name:response.account_user.resource_student.resource_category.parent_rec.parent_rec.name, class_id:response.account_user.resource_student.resource_category.parent_rec.id, class_code:response.account_user.resource_student.resource_category.parent_rec.code, class_name:response.account_user.resource_student.resource_category.parent_rec.name, section_id:response.account_user.resource_student.resource_category.id, section_code:response.account_user.resource_student.resource_category.code, section_name:response.account_user.resource_student.resource_category.name, } } } data={...data, ...general_info}; } return data; } export function* saga() { // takeEvery: // listen for certain actions that are going to be dispatched and take them and run through our worker saga. yield takeLatest(Types.LOGIN_REQUEST, login); yield takeLatest(Types.LOGIN_ACCOUNT_REQUEST, loginAccount); yield takeLatest(Types.SELECT_ROLE_REQUEST, selectRole); yield takeLatest(Types.PROFILE_REQUEST, saveProfile); yield takeLatest(Types.LOGOUT_REQUEST, logout); yield takeLatest(Types.REGISTER_ACCOUNT, register); }
Close