diff --git a/src/components/login/login.ts b/src/components/login/login.ts index 54b92aa..7d578fa 100644 --- a/src/components/login/login.ts +++ b/src/components/login/login.ts @@ -1,4 +1,5 @@ import {Component, Vue} from 'vue-property-decorator'; +import Constants from '@/constants'; /** * This component handles user login, and obtains data from the server. @@ -12,10 +13,21 @@ export default class Login extends Vue public password: any = ''; /** - * On click + * On click, sends username and password to the server. */ public onLoginClick() { + // Call custom event + this.$emit('login:click', this.username, this.password); + // Fetch request TODO: Add username and password when the server is ready. + fetch(`${Constants.API_URL}/veracross/courses`).then(res => + { + // Get response body text + res.text().then(text => + { + }) + }) + .catch(alert); } }