Skip to content

Commit

Permalink
changed login method attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
randilfernando committed Dec 25, 2017
1 parent 2b7527f commit a1a6d93
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ testem.log
# System Files
.DS_Store
Thumbs.db

.ng_pkg_build
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# AuthPackage

Authentication package for angular 5 based on HttpCliendModule. Easy to configure.
This project also contains sample application which you can use to test the package.

## Serve project (Test package)

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "jwt-auth",
"name": "simple-angular-jwt-auth",
"description": "authentication package for angular 5 using HttpClientModule",
"author": "[email protected]",
"version": "0.0.1",
"version": "0.0.2",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"test": "ng test",
"lint": "ng lint",
"packagr": "ng-packagr -p ng-package.json"
"build": "ng-packagr -p ng-package.json"
},
"repository": {
"type": "git",
Expand All @@ -23,7 +23,7 @@
"npm",
"angular5"
],
"private": true,
"private": false,
"dependencies": {
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
Expand Down
5 changes: 2 additions & 3 deletions src/modules/auth/providers/auth.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ export class AuthProvider {
this.authConfig = this.authConfigProvider.getConfig();
}

public async login(username: string, password: string): Promise<boolean> {
const body = {username: username, password: password};
public async login(requestBody: any): Promise<boolean> {
if (this.authConfig.loginUrl) {
const auth = await this.http.post<Auth>(this.authConfig.loginUrl, JSON.stringify(body)).toPromise();
const auth = await this.http.post<Auth>(this.authConfig.loginUrl, JSON.stringify(requestBody)).toPromise();
return await this.setAuth(auth);
} else {
throw new Error('login url not set');
Expand Down

0 comments on commit a1a6d93

Please sign in to comment.