Merge branch 'sch_sso' into 'develop'

Added guarding classes to routes. Fixed director-view

See merge request !53
parents 95b85dd3 e7629bed
......@@ -219,9 +219,8 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
, Response::HTTP_OK);
}
else {
return $this->respondWithStatus([
'message' => t("No students found!!!"),
], Response::HTTP_OK);
$list = array();
return $this->respondWithStatus($list, Response::HTTP_OK);
}
......
......@@ -27,6 +27,9 @@ import { APP_ROUTER_PROVIDERS, APP_DECLARATIONS } from './app.routes';
/* Here we import services */
import {HelperDataService} from './services/helper-data-service';
import {LoaderService} from './services/Spinner.service';
import {AuthService} from './services/auth.service';
import SchoolAuthGuard from './guards/school.auth.guard';
import StudentAuthGuard from './guards/student.auth.guard';
import { ACTION_PROVIDERS } from './actions';
import Home from './components/home';
......@@ -76,6 +79,9 @@ class MyLocalization extends NgLocalization {
//Service1, again services here
HelperDataService,
LoaderService,
AuthService,
SchoolAuthGuard,
StudentAuthGuard
]
})
class AppModule {}
......
import { Component, OnInit, OnDestroy,ElementRef, ViewChild} from "@angular/core";
import { Component, OnInit, OnDestroy, ElementRef, ViewChild} from "@angular/core";
import { Injectable } from "@angular/core";
import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
......@@ -44,7 +44,7 @@ import {
Αναζήτηση
</button>
<div *ngIf="(retrievedStudent | async)">
<div *ngFor="let StudentDetails$ of StudentInfo$ | async">
<div *ngFor="let StudentDetails$ of StudentInfo$ | async; let i=index">
<br>
<br>
Όνομα: {{StudentDetails$.name}} <br>
......@@ -58,7 +58,7 @@ import {
<strong>Επιβεβαίωση Εγγραφής: </strong>
<input #cb class="pull-right" type="checkbox" name="{{ StudentDetails$.id }}" (change)="updateCheckedOptions(StudentDetails$.id, $event)" >
</div>
<!-- </div> -->
</div>
<button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent()">
Επιβεβαίωση Εγγραφής
......@@ -66,7 +66,7 @@ import {
`
})
@Injectable() export default class DirectorView implements OnInit , OnDestroy{
@Injectable() export default class DirectorView implements OnInit, OnDestroy {
public formGroup: FormGroup;
private StudentSelected$: BehaviorSubject<any>;
......@@ -78,16 +78,15 @@ import {
private retrievedStudent: BehaviorSubject<boolean>;
private selectionBClass: BehaviorSubject<boolean>;
private selectionCClass: BehaviorSubject<boolean>;
private SchoolId = 147 ;
private SchoolId = 147;
private currentclass: Number;
private saved :Array<number> = new Array();
private saved: Array<number> = new Array();
constructor( private fb: FormBuilder,
constructor(private fb: FormBuilder,
private _hds: HelperDataService,
private activatedRoute: ActivatedRoute,
private router: Router )
{
private router: Router) {
this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.StudentInfo$ = new BehaviorSubject([{}]);
......@@ -102,8 +101,7 @@ import {
}
ngOnDestroy()
{
ngOnDestroy() {
if (this.StudentSelectedSub)
this.StudentSelectedSub.unsubscribe();
if (this.StudentSelectedSpecialSub)
......@@ -121,107 +119,126 @@ import {
}
verifyclass(txop)
{
verifyclass(txop) {
this.retrievedStudent.next(false);
if (txop.value === "1")
{
if (txop.value === "1") {
this.selectionBClass.next(false);
this.selectionCClass.next(false);
}
else if (txop.value === "2")
{
else if (txop.value === "2") {
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(data => {
this.selectionBClass.next(true);
this.selectionCClass.next(false);
this.StudentSelected$.next(data);
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$);
},
error => {
this.StudentSelected$.next([{}]);
console.log("Error Getting StudentSelectedSpecial");
},
() => console.log("Getting StudentSelectedSpecial"));
}
else if (txop.value === "3")
{
else if (txop.value === "3") {
var sectorint = +this.formGroup.value.tomeas;
console.log(sectorint,"test");
if (this.formGroup.value.tomeas != '')
{
console.log(sectorint, "test");
if (this.formGroup.value.tomeas != '') {
var sectorint = +this.formGroup.value.tomeas;
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$);
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(data => {
this.StudentSelectedSpecial$.next(data);
},
error => {
this.StudentSelectedSpecial$.next([{}]);
console.log("Error Getting StudentSelectedSpecial");
},
() => console.log("Getting StudentSelectedSpecial"));
}
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(data => {
this.StudentSelected$.next(data);
this.selectionBClass.next(true);
this.selectionCClass.next(true);
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$);
},
error => {
this.StudentSelected$.next([{}]);
console.log("Error Getting StudentSelected");
},
() => console.log("Getting StudentSelected"));
}
}
checkbclass(tmop,txop)
{
checkbclass(tmop, txop) {
this.retrievedStudent.next(false);
var sectorint = +this.formGroup.value.tomeas;
console.log(sectorint,"tomeas");
if (txop.value === "3")
{
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$);
console.log(sectorint, "tomeas");
if (txop.value === "3") {
// this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(data => {
this.StudentSelectedSpecial$.next(data);
},
error => {
this.StudentSelectedSpecial$.next([{}]);
console.log("Error Getting StudentSelectedSpecial");
},
() => console.log("Getting StudentSelectedSpecial"));
}
}
findstudent(txop)
{
findstudent(txop) {
var sectorint = +this.formGroup.value.tomeas;
if (txop.value === "1")
{
if (txop.value === "1") {
this.currentclass = 1;
}
else if (txop.value === "2")
{
else if (txop.value === "2") {
this.currentclass = 2;
}
else if (txop.value === "3")
{
else if (txop.value === "3") {
this.currentclass = 3;
}
this.retrievedStudent.next(true);
this.StudentInfo$ = new BehaviorSubject(false);
this.StudentInfoSub = this._hds.getStudentPerSchool(this.SchoolId, sectorint, this.currentclass).subscribe(this.StudentInfo$);
// this.StudentInfo$ = new BehaviorSubject([{}]);
// this.StudentInfoSub = this._hds.getStudentPerSchool(this.SchoolId, sectorint, this.currentclass).subscribe(this.StudentInfo$);
this.StudentInfoSub = this._hds.getStudentPerSchool(this.SchoolId, sectorint, this.currentclass).subscribe(data => {
this.StudentInfo$.next(data);
this.retrievedStudent.next(true);
},
error => {
this.StudentInfo$.next([{}]);
console.log("Error Getting Students");
},
() => console.log("Getting Students"));
}
updateCheckedOptions(id, event)
{
updateCheckedOptions(id, event) {
let i = this.saved.length;
if (event.target.checked === false)
{
var count=this.saved.length;
for(var j=0;j<count;j++)
{
if(this.saved[j]===id)
{
if (event.target.checked === false) {
var count = this.saved.length;
for (var j = 0; j < count; j++) {
if (this.saved[j] === id) {
this.saved.splice(j, 1);
}
}
}
else
{
this.saved[i] = id ;
else {
this.saved[i] = id;
}
}
}
confirmStudent()
{
confirmStudent() {
this._hds.saveConfirmStudents(this.saved);
}
}
checkcclass()
{
checkcclass() {
this.retrievedStudent.next(false);
}
}
}
......@@ -22,8 +22,8 @@
<div *ngIf="(loginInfo$ | async).size > 0" class="pull-right" class="nav-item" [ngClass]="{active: path=='submited-preview'}">
<a class="nav-link" [routerLink]="['/submited-preview']" [routerLinkActive]="['active']"><b>Υποβληθείσες αιτήσεις</b></a>
<a class="nav-link" [routerLink]="['/director-view']" [routerLinkActive]="['active']"><b>Επιλεχθέντες Μαθητές</b></a>
<a class="nav-link" [routerLink]="['/director-classcapacity']" [routerLinkActive]="['active']"><b>Δυναμική Σχολείου</b></a>
<a class="nav-link" [routerLink]="['/school/director-view']" [routerLinkActive]="['active']"><b>Επιλεχθέντες Μαθητές</b></a>
<a class="nav-link" [routerLink]="['/school/director-classcapacity']" [routerLinkActive]="['active']"><b>Δυναμική Σχολείου</b></a>
</div>
</ul>
......
......@@ -65,7 +65,7 @@ export default class SchoolHome implements OnInit {
this.authToken = loginInfoToken.auth_token;
this.authRole = loginInfoToken.auth_role;
if (this.authToken && this.authToken.length > 0)
this.router.navigate(['/director-view']);
this.router.navigate(['/school/director-view']);
return loginInfoToken;
}, {});
}
......
......@@ -47,3 +47,6 @@ export const VALID_EMAIL_PATTERN = '[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{
//DD-MM-YYYY
export const VALID_DATE_PATTERN = '([1-9]|0[1-9]|[12][0-9]|3[01])[- /.]([1-9]|0[1-9]|1[012])[- /.](19|20)[0-9][0-9]';
export const SCHOOL_ROLE = 'director';
export const STUDENT_ROLE = 'student';
......@@ -22,25 +22,27 @@ import SubmitedPreview from '../components/student-application-form/submited.apl
import SubmitedPerson from '../components/student-application-form/submitedstudent.preview';
import DirectorView from '../components/director/director-view';
import DirectorClassCapacity from '../components/director/director-classcapacity';
import SchoolAuthGuard from '../guards/school.auth.guard';
import StudentAuthGuard from '../guards/student.auth.guard';
export const MainRoutes: Routes = [
{ path: '', component: Home },
{ path: 'school', component: SchoolHome },
{ path: 'parent-form', component: ParentForm },
{ path: 'student-application-form-main', component: StudentApplicationMain },
{ path: 'students-list', component: StudentsList },
{ path: 'course-fields-select', component: CourseFieldsSelect },
{ path: 'epal-class-select', component: EpalClassesSelect },
{ path: 'sector-fields-select', component: SectorFieldsSelect },
{ path: 'region-schools-select', component: RegionSchoolsSelect },
{ path: 'sectorcourses-fields-select', component: SectorCoursesSelect },
{ path: 'application-preview', component: ApplicationPreview },
{ path: 'schools-order-select', component: SchoolsOrderSelect },
{ path: 'application-submit', component: ApplicationSubmit },
{ path: 'submited-preview', component: SubmitedPreview },
{ path: 'submited-person', component: SubmitedPerson },
{ path: 'director-view', component: DirectorView },
{ path: 'director-classcapacity', component: DirectorClassCapacity },
{ path: 'parent-form', component: ParentForm, canActivate: [StudentAuthGuard] },
{ path: 'student-application-form-main', component: StudentApplicationMain, canActivate: [StudentAuthGuard] },
// { path: 'students-list', component: StudentsList },
{ path: 'course-fields-select', component: CourseFieldsSelect, canActivate: [StudentAuthGuard] },
{ path: 'epal-class-select', component: EpalClassesSelect, canActivate: [StudentAuthGuard] },
{ path: 'sector-fields-select', component: SectorFieldsSelect, canActivate: [StudentAuthGuard] },
{ path: 'region-schools-select', component: RegionSchoolsSelect, canActivate: [StudentAuthGuard] },
{ path: 'sectorcourses-fields-select', component: SectorCoursesSelect, canActivate: [StudentAuthGuard] },
{ path: 'application-preview', component: ApplicationPreview, canActivate: [StudentAuthGuard] },
{ path: 'schools-order-select', component: SchoolsOrderSelect, canActivate: [StudentAuthGuard] },
{ path: 'application-submit', component: ApplicationSubmit, canActivate: [StudentAuthGuard] },
{ path: 'submited-preview', component: SubmitedPreview, canActivate: [StudentAuthGuard] },
{ path: 'submited-person', component: SubmitedPerson, canActivate: [StudentAuthGuard] },
{ path: 'school/director-view', component: DirectorView, canActivate: [SchoolAuthGuard] },
{ path: 'school/director-classcapacity', component: DirectorClassCapacity, canActivate: [SchoolAuthGuard] },
];
export const MainDeclarations = [
......
import { Injectable } from '@angular/core';
import { CanActivate } from '@angular/router';
import { AuthService } from '../services/auth.service';
import { SCHOOL_ROLE } from '../constants';
@Injectable()
export default class SchoolAuthGuard implements CanActivate {
constructor(private authService: AuthService) {}
canActivate() {
return this.authService.isLoggedIn(SCHOOL_ROLE).then(loggedIn => {return loggedIn;}).catch(err => {return false;});
}
}
import { Injectable } from '@angular/core';
import { CanActivate } from '@angular/router';
import { AuthService } from '../services/auth.service';
import { STUDENT_ROLE } from '../constants';
@Injectable()
export default class StudentAuthGuard implements CanActivate {
constructor(private authService: AuthService) {}
canActivate() {
return this.authService.isLoggedIn(STUDENT_ROLE).then(loggedIn => {return loggedIn;}).catch(err => {return false;});
}
}
import {Injectable} from '@angular/core';
import {BehaviorSubject} from "rxjs/Rx";
import 'rxjs/add/operator/map';
import { AppSettings } from '../app.settings';
import { NgRedux, select } from 'ng2-redux';
import { IAppState } from '../store/store';
import { ILoginInfo, ILoginInfoToken } from '../store/logininfo/logininfo.types';
import { LOGININFO_INITIAL_STATE } from '../store/logininfo/logininfo.initial-state';
@Injectable()
export class AuthService {
constructor(
private _ngRedux: NgRedux<IAppState>) {
};
isLoggedIn(role) {
return new Promise((resolve, reject) => {
this._ngRedux.select(state => {
return state.loginInfo;
}).subscribe(loginInfo => {
if (loginInfo.size > 0) {
loginInfo.reduce(({}, loginInfoToken) => {
if (loginInfoToken.auth_token && loginInfoToken.auth_token.length > 0 && loginInfoToken.auth_role === role) {
resolve(true);
}
else {
resolve(false);
}
return loginInfoToken;
}, {});
} else
resolve(false);
},
error => {
console.log("Error Sending Verification Code");
reject("Error Getting Auth Data");
},
() => console.log("Getting Auth Data"));
});
}
}
......@@ -17,7 +17,7 @@ import { LOGININFO_INITIAL_STATE } from '../store/logininfo/logininfo.initial-st
const HEADER = { headers: new Headers({ 'Content-Type': 'application/json' }) };
@Injectable()
export class HelperDataService implements OnInit, OnDestroy{
export class HelperDataService implements OnInit, OnDestroy {
private authToken: string;
private authRole: string;
......@@ -75,14 +75,14 @@ export class HelperDataService implements OnInit, OnDestroy{
console.log("authRole=" + this.authRole);
let headers = new Headers({
"Content-Type": "application/json",
// "Accept": "*/*",
// "Access-Control-Allow-Credentials": "true",
// "Accept": "*/*",
// "Access-Control-Allow-Credentials": "true",
});
this.createAuthorizationHeader(headers);
// let options = new RequestOptions({ headers: headers, withCredentials: true });
// let options = new RequestOptions({ headers: headers, withCredentials: true });
let options = new RequestOptions({ headers: headers });
return new Promise((resolve, reject) => {
this.http.post(`${AppSettings.API_ENDPOINT}/epal/user/sendvercode`, {userEmail: email}, options)
this.http.post(`${AppSettings.API_ENDPOINT}/epal/user/sendvercode`, { userEmail: email }, options)
.map(response => response.json())
.subscribe(data => {
resolve(data);
......@@ -104,15 +104,15 @@ export class HelperDataService implements OnInit, OnDestroy{
console.log("authRole=" + this.authRole);
let headers = new Headers({
"Content-Type": "application/json",
// "Accept": "*/*",
// "Access-Control-Allow-Credentials": "true",
// "Accept": "*/*",
// "Access-Control-Allow-Credentials": "true",
});
this.createAuthorizationHeader(headers);
// let options = new RequestOptions({ headers: headers, withCredentials: true });
// let options = new RequestOptions({ headers: headers, withCredentials: true });
let options = new RequestOptions({ headers: headers });
return new Promise((resolve, reject) => {
console.log("verificationCode=" + verificationCode);
this.http.post(`${AppSettings.API_ENDPOINT}/epal/user/verifyvercode`, {verificationCode: verificationCode}, options)
this.http.post(`${AppSettings.API_ENDPOINT}/epal/user/verifyvercode`, { verificationCode: verificationCode }, options)
.map(response => response.json())
.subscribe(data => {
resolve(<any>data);
......@@ -138,7 +138,7 @@ export class HelperDataService implements OnInit, OnDestroy{
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
return new Promise((resolve, reject) => {
this.http.post(`${AppSettings.API_ENDPOINT}/epal/user/save`, {userProfile: userProfile}, options)
this.http.post(`${AppSettings.API_ENDPOINT}/epal/user/save`, { userProfile: userProfile }, options)
.map(response => response.json())
.subscribe(data => {
resolve(data);
......@@ -168,8 +168,8 @@ export class HelperDataService implements OnInit, OnDestroy{
//"X-CSRF-Token": "hVtACDJjFRSyE4bgGJENHbXY0B9yNhF71Fw-cYHSDNY"
//"X-CSRF-Token": "fj1QtF_Z_p6kE19EdCnN08zoSjVfcT4Up-ciW6I0IG8"
"X-CSRF-Token": "EHu964c7gN7M399UfHiHHv06x1Tx5cl-P-9ZyMdmGbw",
// "X-oauth-enabled": "true",
// "X-Auth-Token": this.authToken
// "X-oauth-enabled": "true",
// "X-Auth-Token": this.authToken
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
......@@ -202,8 +202,8 @@ export class HelperDataService implements OnInit, OnDestroy{
//"X-CSRF-Token": "hVtACDJjFRSyE4bgGJENHbXY0B9yNhF71Fw-cYHSDNY"
//"X-CSRF-Token": "fj1QtF_Z_p6kE19EdCnN08zoSjVfcT4Up-ciW6I0IG8"
"X-CSRF-Token": "LU92FaWYfImfZxfldkF5eVnssdHoV7Aa9fg8K1bWYUc",
// "X-oauth-enabled": "true",
// "X-Auth-Token": this.authToken
// "X-oauth-enabled": "true",
// "X-Auth-Token": this.authToken
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
......@@ -221,7 +221,7 @@ export class HelperDataService implements OnInit, OnDestroy{
});
};
getRegionsWithSchools(classActive,courseActive) {
getRegionsWithSchools(classActive, courseActive) {
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
this.authRole = loginInfoToken.auth_role;
......@@ -236,8 +236,8 @@ export class HelperDataService implements OnInit, OnDestroy{
//"X-CSRF-Token": "hVtACDJjFRSyE4bgGJENHbXY0B9yNhF71Fw-cYHSDNY"
//"X-CSRF-Token": "fj1QtF_Z_p6kE19EdCnN08zoSjVfcT4Up-ciW6I0IG8"
"X-CSRF-Token": "LU92FaWYfImfZxfldkF5eVnssdHoV7Aa9fg8K1bWYUc",
// "X-oauth-enabled": "true",
// "X-Auth-Token": this.authToken
// "X-oauth-enabled": "true",
// "X-Auth-Token": this.authToken
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
......@@ -280,8 +280,8 @@ export class HelperDataService implements OnInit, OnDestroy{
//"X-CSRF-Token": "hVtACDJjFRSyE4bgGJENHbXY0B9yNhF71Fw-cYHSDNY"
//"X-CSRF-Token": "fj1QtF_Z_p6kE19EdCnN08zoSjVfcT4Up-ciW6I0IG8"
"X-CSRF-Token": "LU92FaWYfImfZxfldkF5eVnssdHoV7Aa9fg8K1bWYUc",
// "X-oauth-enabled": "true",
// "X-Auth-Token": this.authToken
// "X-oauth-enabled": "true",
// "X-Auth-Token": this.authToken
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
......@@ -307,14 +307,14 @@ export class HelperDataService implements OnInit, OnDestroy{
trackRegionId = "";
trackIndex = -1;
let j=0;
let j = 0;
regionSchools.forEach(regionSchool => {
if (trackRegionId !== regionSchool.region_id) {
trackIndex++;
rsa.push(<IRegion>{'region_id': regionSchool.region_id, 'region_name': regionSchool.region_name, 'epals': Array<IRegionSchool>()});
rsa.push(<IRegion>{ 'region_id': regionSchool.region_id, 'region_name': regionSchool.region_name, 'epals': Array<IRegionSchool>() });
trackRegionId = regionSchool.region_id;
}
rsa[trackIndex].epals.push(<IRegionSchool>{'epal_id': regionSchool.epal_id, 'epal_name': regionSchool.epal_name, 'epal_special_case': regionSchool.epal_special_case, 'globalIndex': j, 'selected': false, 'order_id': 0});
rsa[trackIndex].epals.push(<IRegionSchool>{ 'epal_id': regionSchool.epal_id, 'epal_name': regionSchool.epal_name, 'epal_special_case': regionSchool.epal_special_case, 'globalIndex': j, 'selected': false, 'order_id': 0 });
j++;
});
return rsa;
......@@ -328,14 +328,14 @@ export class HelperDataService implements OnInit, OnDestroy{
trackSectorId = "";
trackIndex = -1;
let j=0;
let j = 0;
sectorCourses.forEach(sectorCourse => {
if (trackSectorId !== sectorCourse.sector_id) {
trackIndex++;
rsa.push(<ISector>{'sector_id': sectorCourse.sector_id, 'sector_name': sectorCourse.sector_name, 'sector_selected': false, 'courses': Array<ISectorCourse>()});
rsa.push(<ISector>{ 'sector_id': sectorCourse.sector_id, 'sector_name': sectorCourse.sector_name, 'sector_selected': false, 'courses': Array<ISectorCourse>() });
trackSectorId = sectorCourse.sector_id;
}
rsa[trackIndex].courses.push(<ISectorCourse>{'course_id': sectorCourse.course_id, 'course_name': sectorCourse.course_name, 'globalIndex': j, 'selected': false});
rsa[trackIndex].courses.push(<ISectorCourse>{ 'course_id': sectorCourse.course_id, 'course_name': sectorCourse.course_name, 'globalIndex': j, 'selected': false });
j++;
});
return rsa;
......@@ -382,8 +382,8 @@ export class HelperDataService implements OnInit, OnDestroy{
//"X-CSRF-Token": "hVtACDJjFRSyE4bgGJENHbXY0B9yNhF71Fw-cYHSDNY"
//"X-CSRF-Token": "fj1QtF_Z_p6kE19EdCnN08zoSjVfcT4Up-ciW6I0IG8"
"X-CSRF-Token": "LU92FaWYfImfZxfldkF5eVnssdHoV7Aa9fg8K1bWYUc",
// "X-oauth-enabled": "true",
// "X-Auth-Token": this.authToken
// "X-oauth-enabled": "true",
// "X-Auth-Token": this.authToken
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
......@@ -399,13 +399,13 @@ export class HelperDataService implements OnInit, OnDestroy{
},
() => console.log("UserName Received"));
});
}
}
transformUserSchema(userlogin:any,oauthtoken:string, oauthrole:string){
transformUserSchema(userlogin: any, oauthtoken: string, oauthrole: string) {
let rsa = Array<ILoginInfoToken>();
rsa.push(<ILoginInfoToken>{'auth_token': oauthtoken, 'auth_role': oauthrole, 'cu_name':userlogin.name});
rsa.push(<ILoginInfoToken>{ 'auth_token': oauthtoken, 'auth_role': oauthrole, 'cu_name': userlogin.name });
return rsa;
}
......@@ -429,8 +429,8 @@ export class HelperDataService implements OnInit, OnDestroy{
//"X-CSRF-Token": "hVtACDJjFRSyE4bgGJENHbXY0B9yNhF71Fw-cYHSDNY"
//"X-CSRF-Token": "fj1QtF_Z_p6kE19EdCnN08zoSjVfcT4Up-ciW6I0IG8"
"X-CSRF-Token": "EoAZ0APpIbbewK5MNzRrCFkvEeZZoGQsBslWFTrZ8bI",
// "X-oauth-enabled": "true",
// "X-Auth-Token": this.authToken
// "X-oauth-enabled": "true",
// "X-Auth-Token": this.authToken
});
this.createAuthorizationHeader(headers);