const app = require('../app') app.component('appLoginPage', { template: html`
Login Forgot password
`, controllerAs: 'login', controller: function(api, $mdToast, $location) { api.get('/api/auth/check').then(() => { $location.url('/dashboard') }, err => { console.info('Not logged in: ', err) }) this.submit = async form => { try { const res = await api.login(this.model) $location.url('/dashboard') } catch (err) { $mdToast.showSimple(`Login failed`) } } } })