-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(context): use api to retrieve contexts
- Loading branch information
Showing
25 changed files
with
322 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
<div *ngIf="!auth.logged" class="backgroundDisable"></div> | ||
<div *ngIf="!auth.logged && backgroundDisable" class="backgroundDisable"></div> | ||
|
||
<div *ngIf="!auth.logged" class="login center-block"> | ||
<h1>{{'igo.auth.connection' | translate}}</h1> | ||
|
||
<igo-auth-google *ngIf="options.google && options.google.enabled !== false"></igo-auth-google> | ||
<igo-auth-facebook *ngIf="options.facebook && options.facebook.enabled !== false"></igo-auth-facebook> | ||
<igo-auth-intern *ngIf="!options.intern || options.intern.enabled !== false"></igo-auth-intern> | ||
<igo-auth-google | ||
*ngIf="options.google && options.google.enabled !== false" | ||
(onLogin)="login()"> | ||
</igo-auth-google> | ||
<igo-auth-facebook | ||
*ngIf="options.facebook && options.facebook.enabled !== false" | ||
(onLogin)="login()"> | ||
</igo-auth-facebook> | ||
<igo-auth-intern | ||
*ngIf="!options.intern || options.intern.enabled !== false" | ||
(onLogin)="login()"> | ||
</igo-auth-intern> | ||
</div> | ||
|
||
<div *ngIf="auth.logged && alreadyConnectedDiv" class="login center-block"> | ||
<p>{{'igo.auth.welcome' | translate: user}}</p> | ||
<button (click)="logout()">{{'igo.auth.signOut' | translate}}</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
|
||
import { AuthFormComponent } from './auth-form'; | ||
|
||
const routes: Routes = [ | ||
{ path: 'login', component: AuthFormComponent }, | ||
{ path: 'logout', component: AuthFormComponent } | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule], | ||
providers: [] | ||
}) | ||
export class AuthRoutingModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Http, RequestOptions } from '@angular/http'; | ||
import { AuthHttp, AuthConfig } from 'angular2-jwt'; | ||
|
||
import { ConfigService } from '../../core'; | ||
|
||
export function authHttpServiceFactory(http: Http, options: RequestOptions, | ||
config: ConfigService) { | ||
|
||
const authConfig = config.getConfig('auth') || {}; | ||
|
||
return new AuthHttp(new AuthConfig({ | ||
headerName: 'Authorization', | ||
headerPrefix: '', | ||
tokenName: authConfig.tokenKey, | ||
tokenGetter: (() => localStorage.getItem(authConfig.tokenKey)), | ||
noJwtError: true | ||
}), http, options); | ||
} |
Oops, something went wrong.