This file contains hidden or 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
| # From https://coderwall.com/p/euwpig/a-better-git-log | |
| git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | |
| # add it to globalconfig | |
| git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
| # rest head | |
| git reset --hard HEAD^ | |
| # reset head by number of commits |
This file contains hidden or 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
| git clone https://github.com/qdouble/angular-webpack-starter.git angular-keycloak | |
| cd angular-keycloak | |
| npm install | |
| npm run start:hmr |
This file contains hidden or 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
| <script type="text/javascript" | |
| src="<%= htmlWebpackPlugin.options.keycloakUrl %>/auth/js/keycloak.min.js"></script> |
This file contains hidden or 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
| { | |
| "realm": "name of the realm", | |
| "auth-server-url": "keycloak authorization endpoint", | |
| "ssl-required": "external", | |
| "resource": "name of the resource", | |
| "public-client": true, | |
| "use-resource-role-mappings": true | |
| } |
This file contains hidden or 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
| import { KeycloakLoginCheckResponse } from './../keycloak/keycloak.model'; | |
| import { Observable } from 'rxjs/Observable'; | |
| import { Injectable } from '@angular/core'; | |
| import './keycloak'; | |
| import { Observer } from 'rxjs/Observer'; | |
| declare const Keycloak: any; | |
| @Injectable() | |
| export class KeycloakApiService { |
This file contains hidden or 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
| import { KeycloakLoginCheckResponse } from './keycloak.model'; | |
| import { Response } from '@angular/http'; | |
| import { Action } from '@ngrx/store'; | |
| export enum KeycloakActionTypes { | |
| IsLoggedInCheck = '[Keycloak] Is Loggedin Check', | |
| IsLoggedInCheckSuccess = '[Keycloak] Is Logged In Check Success', | |
| IsLoggedInCheckFail = '[Keycloak] Is Logged In Check Fail', | |
| Login = '[Keycloak] Login', | |
| LoginSuccess = '[Keycloak] Login Success', |
This file contains hidden or 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
| import { KeycloakActionTypes, IsLoggedInCheckSuccess, LoginSuccess } from './keycloak.actions'; | |
| import { KeycloakApiService } from './keycloak-api.service'; | |
| /* tslint:disable: member-ordering */ | |
| import { Injectable } from '@angular/core'; | |
| import { Actions, Effect } from '@ngrx/effects'; | |
| import { Store } from '@ngrx/store'; | |
| import { Observable } from 'rxjs/Observable'; | |
| import { | |
| IsLoggedInCheck |
This file contains hidden or 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
| import { AppState } from '../reducers'; | |
| /* tslint:disable: no-switch-case-fall-through */ | |
| import { Action } from '@ngrx/store'; | |
| import { KeycloakActions, KeycloakActionTypes, LoginSuccess } from './keycloak.actions'; | |
| import { KeycloakModel } from './keycloak.model'; | |
| export interface KeycloakState { | |
| keycloakModel: KeycloakModel; | |
| checkingKeycloakStatus: boolean; |
This file contains hidden or 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
| export interface KeycloakModel { | |
| readonly isLoggedIn: boolean; | |
| readonly showLoading: boolean; | |
| readonly id: string; | |
| readonly needsLogin: boolean; | |
| } | |
| export interface KeycloakLoginCheckResponse { | |
| loggedIn: boolean; | |
| idmId: string; |
This file contains hidden or 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
| import { | |
| StoreModule, | |
| ActionReducerMap, | |
| MetaReducer, | |
| createFeatureSelector, | |
| createSelector | |
| } from '@ngrx/store'; | |
| import { Params, RouterStateSnapshot } from '@angular/router'; | |
| import { compose } from '@ngrx/store'; | |
| import { ActionReducer, combineReducers } from '@ngrx/store'; |