diff --git a/src/app/components/login/login.component.html b/src/app/components/login/login.component.html index e71540b..a29a884 100644 --- a/src/app/components/login/login.component.html +++ b/src/app/components/login/login.component.html @@ -1,17 +1,20 @@ +
password: | - |
+ |
repeat password: | diff --git a/src/app/components/register/register.component.sass b/src/app/components/register/register.component.sass index 01893ff..54ae275 100644 --- a/src/app/components/register/register.component.sass +++ b/src/app/components/register/register.component.sass @@ -3,7 +3,7 @@ #register background-color: $cSecondaryBackground - grid-template: 15% 70% 15% / 15% 70% 15% + grid-template: 8% 77% 15% / 15% 70% 15% display: grid min-height: 100vh max-height: 100vh @@ -15,6 +15,10 @@ padding: 1em input margin: 0.25em - -#header - @include gridPosition(1, 2, 1, 2) + +#headerbar + @include gridPosition(1, 1, 1, 4) + display: grid + grid-template: 100% /30% 10% 10% 10% 10% 10% 15% 5% + background-color: $cHeadPrimaryBackground + color: $cHeadFontColor diff --git a/src/app/models/login.ts b/src/app/models/login.ts new file mode 100644 index 0000000..30aeb8f --- /dev/null +++ b/src/app/models/login.ts @@ -0,0 +1,4 @@ +export interface Login { + email: string; + passwordHash: string + } \ No newline at end of file diff --git a/src/app/services/login/login.service.ts b/src/app/services/login/login.service.ts index 92c777e..ee3e5c0 100644 --- a/src/app/services/login/login.service.ts +++ b/src/app/services/login/login.service.ts @@ -1,9 +1,32 @@ import { Injectable } from '@angular/core'; +import {Http, URLSearchParams, Headers} from '@angular/http'; +import { Login } from '../../models/login'; @Injectable({ providedIn: 'root' }) export class LoginService { - constructor() { } + constructor(private http: Http) { } + + public login(login : Login) { + + //let url = './graphql' + let url = 'https://greenvironment.net/graphql' + + let headers = new Headers(); + headers.set('Content-Type', 'application/json'); + + return this.http.post(url, this.buildJson(login)).subscribe(response => console.log(response.text())); + } + + public buildJson(login: Login): any { + const body = {query: `mutation($email: String, $pwHash: String) { + login(email: $email, passwordHash: $pwHash) {id} + }`, variables: { + email: login.email, + pwHash: login.passwordHash, + }}; + return body; + } }