Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
try {
await vueAuth.login(form).then(() => {
commit("isAuthenticated", {
isAuthenticated: vueAuth.isAuthenticated()
});
});
await dispatch("fetchMe");
form.busy = false;
vm.$router.push({ name: "dashboard" });
} catch (error) {
form.errors.set(error.response.data.errors);
form.busy = false;
if (error.response.status === 401) {
let modal = swal.mixin({
confirmButtonClass: "v-btn blue-grey subheading white--text",
buttonsStyling: false
});
modal.fire({
title: `${error.response.data.error}`,
html: `<p class="title">${error.response.data.message}</p>`,
type: "error",
confirmButtonText: "Back"
});
}
}
},
/* form : name,email ,provider(fb),provider_user_id(fb_id) */
this.$validator.validateAll().then(result => {
if (result) {
// eslint-disable-next-line
self.createUser();
} else {
const validationModal = swal.mixin({
confirmButtonClass: "v-btn blue-grey subheading white--text",
buttonsStyling: false
});
validationModal.fire({
title: `Validation Error`,
html: `<p class="title">Please Fix Form Errors</p>`,
type: "warning",
confirmButtonText: "Back"
});
}
});
},
import {routes} from './routes';
Vue.component('example-component', require('./components/ExampleComponent.vue'));
Vue.component('admin-main', require('./components/admin/AdminMaster.vue'));
Vue.component('home-main', require('./components/public/PublicMaster.vue'));
// V-form
import { Form, HasError, AlertError } from 'vform'
Vue.component(HasError.name, HasError)
Vue.component(AlertError.name, AlertError)
window.Form = Form;
// Sweet alert 2
import swal from 'sweetalert2'
window.swal = swal;
const toast = swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 3000
});
window.toast = toast
const router = new VueRouter({
routes, // short for `routes: routes`
mode:'hash',
})
.catch(errors => {
console.log(errors);
if (errors.response.data.message) {
let toggleModal = swal.mixin({
confirmButtonClass: "v-btn blue-grey subheading white--text",
buttonsStyling: false
});
toggleModal.fire({
title: "Oops! Something Went Wrong...",
html: '<p class="title">' + errors.response.data.message + "</p>",
type: "error",
confirmButtonText: "Back"
});
}
self.selected = [];
Bus.$emit("close-modal-mass-mail");
});
},
.then(response => {
console.log(response.data);
self.$validator.reset();
const successModal = swal.mixin({
confirmButtonClass: "v-btn blue-grey subheading white--text",
buttonsStyling: false
});
successModal.fire({
title: "Success!",
html: `<p class="title">User Has Been Created!</p>`,
type: "success",
confirmButtonText: "Ok"
});
self.$nextTick(() => self.$router.push({ name: "users" }));
})
.catch(errors => {});
this.$validator.validate().then(result => {
if (result) {
Bus.$emit("send-mass-mail", this.form);
} else {
let modal = swal.mixin({
confirmButtonClass: "v-btn blue-grey subheading white--text",
buttonsStyling: false
});
modal.fire({
title: "Validation Error!",
html: '<p class="title">Please Complete Form To Send Mail!</p>',
type: "error",
confirmButtonText: "Back"
});
}
});
}
} catch (err) {
console.error('Failed to set output file modified time', err);
}
}
async function transferTimestampsWithOffset(inPath, outPath, offset) {
try {
const stat = await fs.statAsync(inPath);
const time = (stat.mtime.getTime() / 1000) + offset;
await fs.utimesAsync(outPath, time, time);
} catch (err) {
console.error('Failed to set output file modified time', err);
}
}
const toast = swal.mixin({
toast: true,
position: 'top',
showConfirmButton: false,
timer: 5000,
});
const errorToast = title => toast.fire({
type: 'error',
title,
});
async function showFfmpegFail(err) {
console.error(err);
return errorToast(`Failed to run ffmpeg: ${err.stack}`);
}
window._ = require('lodash');
try {
window.Vue = require('vue');
window.Popper = require('popper.js').default;
window.$ = window.jQuery = require('jquery');
window.PerfectScrollbar = require('perfect-scrollbar').default;
window.moment = require('moment');
window.Swal = require('sweetalert2').mixin({
customClass: {
confirmButton: 'btn btn-success',
cancelButton: 'btn btn-danger'
},
buttonsStyling: false,
});
require('bootstrap');
require('bootstrap-material-design');
} catch (e) {
console.error(e);
}
Vue.use(require('./plugin').default);
require('./material-dashboard');
require('./scripts');
*/
require('./bootstrap');
window.Vue = require('vue');
import moment from 'moment';
import { Form, HasError, AlertError } from 'vform';
import Gate from "./Gate";
Vue.prototype.$gate = new Gate(window.user);
import swal from 'sweetalert2'
window.swal = swal;
const toast = swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 3000
});
window.toast = toast;
window.Form = Form;
Vue.component(HasError.name, HasError)
Vue.component(AlertError.name, AlertError)
Vue.component('pagination', require('laravel-vue-pagination'));
require('./bootstrap');
window.Vue = require('vue');
import moment from 'moment';
import { Form, HasError, AlertError } from 'vform';
window.Form = Form;
import Gate from "./Gate";
Vue.prototype.$gate = new Gate(window.user);
import Swal from 'sweetalert2';
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 3000,
timerProgressBar: true,
onOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
window.Swal = Swal;
window.Toast = Toast;
import VueProgressBar from 'vue-progressbar'
Vue.use(VueProgressBar, {
color: 'rgb(143, 255, 199)',