Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
eba1717
Initial plan
Copilot Mar 19, 2026
9b17452
fix: migrate side-nav-auth igx-ts template to angular-auth-oidc-clien…
Copilot Mar 19, 2026
dcec8e5
fix(igx-ts): update the providers to fix build errors
Hristo313 Mar 19, 2026
740b8fe
refactor: remove NgModule files and convert side-nav-auth to fully st…
Copilot Mar 19, 2026
2658cf5
fix: remove standalone: true decorators and guard against "undefined"…
Copilot Mar 19, 2026
4582360
refactor: extract provideAuthentication() to keep auth config self-co…
Copilot Mar 19, 2026
455460d
merge master
Hristo313 Mar 20, 2026
fbdbef8
Merge branch 'master' into copilot/refactor-side-navigation-auth-temp…
Hristo313 Mar 20, 2026
62e36c6
refactor: migrate spec files from Jasmine to Vitest syntax (vi.fn, vi…
Copilot Mar 20, 2026
96e8c95
fix(igx-ts): fixing build tests errors
Hristo313 Mar 20, 2026
c4cb896
fix: sync formatUserData in providers, mock close/navigate spies in s…
Copilot Mar 20, 2026
2252821
revert: undo c4cb896 provider/spec changes and restore yarn.lock
Copilot Mar 20, 2026
2dd06a8
fix(igx-ts): fix failing tests
Hristo313 Mar 20, 2026
4eb4a78
Merge branch 'master' into copilot/refactor-side-navigation-auth-temp…
Hristo313 Mar 20, 2026
ac3f5e3
refactor: wire OIDC configs via OidcConfigLoader, fix route data shap…
Copilot Mar 23, 2026
b7697ea
fix(igx-ts): update spec files
Hristo313 Mar 23, 2026
97ac362
refactor: remove OidcConfigLoader, simplify ExternalAuth and provideA…
Copilot Mar 23, 2026
67bf7be
chore: add TODO comments for OIDC clientID usage in addGoogle/addMicr…
Copilot Mar 23, 2026
e75af5c
fix: remove unused clientID params from addGoogle/addMicrosoft, drop …
Copilot Mar 23, 2026
4f06d3f
fix(igx-ts): add home route
Hristo313 Mar 24, 2026
09f09f8
feat: restore social provider registration comments in App constructo…
Copilot Mar 24, 2026
30cf341
fix: use clearer CLIENT_ID placeholder for Facebook provider
Copilot Mar 24, 2026
7198fc6
fix(igx-ts): add clientId to microsoft and google login
Hristo313 Mar 24, 2026
8355531
fix(igx-ts): fix tests
Hristo313 Mar 24, 2026
ad5db64
fix(igx-ts): fix login
Hristo313 Mar 25, 2026
6d18c67
Merge branch 'master' into copilot/refactor-side-navigation-auth-temp…
Hristo313 Mar 25, 2026
1348032
fix(igx-ts): fix tests
Hristo313 Mar 25, 2026
3947cb4
fix(igx-ts): update the provide auth
Hristo313 Mar 26, 2026
e504f1f
Merge branch 'master' into copilot/refactor-side-navigation-auth-temp…
Hristo313 Mar 27, 2026
cf76d0d
Merge branch 'master' into copilot/refactor-side-navigation-auth-temp…
Hristo313 Mar 27, 2026
dcbf515
fix(igx-ts): fix configuration of multiple providers problem
Hristo313 Mar 27, 2026
24a7db3
Externalize OIDC configs to oidc-configs.ts; provideAuthentication() …
Copilot Mar 27, 2026
658a2bd
fix(igx-ts): add fixes
Hristo313 Mar 27, 2026
6ba1589
Move social provider registration from app.ts into provideAuthenticat…
Copilot Mar 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"experimentalDecorators": true,
"importHelpers": true,
"target": "ES2022",
"module": "preserve"
"module": "preserve",
"moduleResolution": "Bundler"
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@angular/platform-browser": "~21.2.0",
"@angular/platform-browser-dynamic": "~21.2.0",
"@angular/router": "~21.2.0",
"angular-auth-oidc-client": "~15.0.4",
"angular-auth-oidc-client": "~21.0.1",
"hammerjs": "~2.0.8",
"igniteui-angular": "~21.1.0",
"minireset.css": "~0.0.7",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
IgxRippleModule,
} from '<%=igxPackage%>';

import { AuthenticationModule, ExternalAuth } from './authentication';
import { oidcConfigs, provideAuthentication } from './authentication';
import { routes } from './app.routes';

export const appConfig: ApplicationConfig = {
Expand All @@ -24,9 +24,8 @@ export const appConfig: ApplicationConfig = {
IgxNavbarModule,
IgxNavigationDrawerModule,
IgxRippleModule,
AuthenticationModule
),
provideAnimations(),
ExternalAuth
provideAuthentication(oidcConfigs)
]
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
import { Routes } from '@angular/router';
import { AuthGuard } from './authentication/auth.guard';
import { Home } from './home/home';
import { Profile } from './authentication/profile/profile';
import { Redirect } from './authentication/redirect/redirect';
import { ExternalAuthProvider } from './authentication/services/external-auth-configs';
import { ExternalAuthRedirectUrl } from './authentication/services/external-auth';

export const routes: Routes = [];
export const routes: Routes = [
{ path: '', redirectTo: '/home', pathMatch: 'full' },
{ path: 'home', component: Home, data: { text: 'Home' } },
{ path: 'profile', component: Profile, canActivate: [AuthGuard] },
{ path: ExternalAuthRedirectUrl.Google, component: Redirect, data: { provider: ExternalAuthProvider.Google } },
{ path: ExternalAuthRedirectUrl.Facebook, component: Redirect, data: { provider: ExternalAuthProvider.Facebook } },
{ path: ExternalAuthRedirectUrl.Microsoft, component: Redirect, data: { provider: ExternalAuthProvider.Microsoft } }
];
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { RouterModule } from '@angular/router';
import { IgxLayoutModule, IgxNavbarModule, IgxNavigationDrawerModule, IgxRippleModule } from 'igniteui-angular';
import { App } from './app';
import { AuthenticationModule } from './authentication';
import { provideAuthentication } from './authentication/provide-authentication';

describe('App', () => {
beforeEach(async () => {
Expand All @@ -12,11 +12,13 @@ describe('App', () => {
NoopAnimationsModule,
RouterModule.forRoot([]),
IgxNavigationDrawerModule,
AuthenticationModule,
IgxNavbarModule,
IgxLayoutModule,
IgxRippleModule,
App
],
providers: [
...provideAuthentication()
]
}).compileComponents();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { AuthGuard } from './auth.guard';
describe('AuthGuard', () => {
let mockRouter: any;
let mockUserService: any;

afterEach(() => { vi.restoreAllMocks(); });

beforeEach(() => {
mockRouter = {
navigate: () => { }
Expand All @@ -19,14 +22,14 @@ describe('AuthGuard', () => {

it(`Should properly call 'canActivate'`, () => {
const authGuard = new AuthGuard(mockRouter, mockUserService);
const mockSpy = jasmine.createSpy('mockSpy');
const mockSpy = vi.fn();
expect(authGuard.canActivate(mockSpy as any, mockSpy as any)).toEqual(true);
});
it(`Should properly call 'canActivate'`, () => {
const authGuard = new AuthGuard(mockRouter, mockUserService);
const mockSpy = jasmine.createSpy('mockSpy');
const mockSpy = vi.fn();
mockUserService.currentUser = false;
spyOn(mockRouter, 'navigate');
vi.spyOn(mockRouter, 'navigate');
expect(authGuard.canActivate(mockSpy as any, { url: 'test' } as any)).toEqual(false);
expect(mockRouter.navigate).toHaveBeenCalled();
expect(mockRouter.navigate).toHaveBeenCalledWith([''], { queryParams: { returnUrl: 'test' } });
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export * from './auth.guard';
export * from './authentication-routing-module';
export * from './authentication-module';
export * from './models/login';
export * from './models/register-info';
export * from './models/user';
export * from './oidc-configs';
export * from './provide-authentication';
export * from './services/authentication';
export * from './services/external-auth';
export * from './services/user-store';
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<button class="login-button" *ngIf="userStore.currentUser" igxRipple="white" igxButton="flat" igxButtonBackground="c"
igxButtonColor="white" [igxToggleAction]="options">
<igx-avatar [initials]="userStore.initials ?? ''" [src]="userStore.currentUser.picture ?? ''"
[roundShape]="true" size="small" bgColor="white">
shape="circle" size="small" bgColor="white">
</igx-avatar>
<igx-icon>keyboard_arrow_down</igx-icon>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
import { AuthModule } from 'angular-auth-oidc-client';
import {
IgxAvatarComponent,
IgxAvatarModule,
Expand All @@ -18,6 +17,7 @@ import {
import { LoginDialog } from '../login-dialog/login-dialog';
import { ExternalAuth } from '../services/external-auth';
import { UserStore } from '../services/user-store';
import { provideAuthentication } from '../provide-authentication';
import { LoginBar } from './login-bar';

@Component({
Expand All @@ -33,7 +33,7 @@ import { LoginBar } from './login-bar';
IgxToggleModule]
})
class TestLoginDialog extends LoginDialog {
open() { }
override open() { }
}

describe('LoginBar', () => {
Expand All @@ -47,14 +47,16 @@ describe('LoginBar', () => {

class MockExternalAuth {
logout() { }
hasProvider() { }
}

afterEach(() => { vi.restoreAllMocks(); });

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
RouterTestingModule,
NoopAnimationsModule,
AuthModule,
IgxAvatarModule,
IgxButtonModule,
IgxDialogModule,
Expand All @@ -66,6 +68,7 @@ describe('LoginBar', () => {
TestLoginDialog
],
providers: [
...provideAuthentication(),
{ provide: UserStore, useClass: TestUserServSpy },
{ provide: ExternalAuth, useClass: MockExternalAuth }
]
Expand All @@ -85,15 +88,15 @@ describe('LoginBar', () => {

it('should switch between buttons based on logged user ', () => {
let buttons = fixture.debugElement.queryAll(By.css('button'));
expect(buttons.length).toBe(1);
expect(buttons.length).toBe(2);
expect(buttons[0].nativeElement.innerText).toBe('Log In');
const userStore = TestBed.inject(UserStore);
spyOnProperty(userStore, 'currentUser', 'get').and.returnValue({
vi.spyOn(userStore, 'currentUser', 'get').mockReturnValue({
picture: 'picture'
});
} as any);
fixture.detectChanges();
buttons = fixture.debugElement.queryAll(By.css('button'));
expect(buttons.length).toBe(1);
expect(buttons.length).toBe(2);
expect(buttons[0].nativeElement.children.length).toEqual(2);
const avatar: IgxAvatarComponent = fixture.debugElement.query(By.css('igx-avatar')).componentInstance;
expect(avatar.src).toBe('picture');
Expand All @@ -104,16 +107,16 @@ describe('LoginBar', () => {
component.loginDialog = new TestLoginDialog();

const button = fixture.debugElement.query(By.css('button'));
spyOn(component.loginDialog, 'open');
vi.spyOn(component.loginDialog, 'open');
button.triggerEventHandler('click', {});
expect(component.loginDialog.open).toHaveBeenCalled();
});

it('should open drop down on button click (logged in)', async () => {
const userStore = TestBed.inject(UserStore);
spyOnProperty(userStore, 'currentUser', 'get').and.returnValue({
vi.spyOn(userStore, 'currentUser', 'get').mockReturnValue({
picture: 'picture'
});
} as any);
fixture.detectChanges();

const button = fixture.debugElement.query(By.css('button'));
Expand All @@ -126,9 +129,9 @@ describe('LoginBar', () => {
const userStore = TestBed.inject(UserStore);
const externalAuth = TestBed.inject(ExternalAuth);
const router: Router = TestBed.inject(Router);
spyOn(router, 'navigate');
spyOn(userStore, 'clearCurrentUser');
spyOn(externalAuth, 'logout');
vi.spyOn(router, 'navigate');
vi.spyOn(userStore, 'clearCurrentUser');
vi.spyOn(externalAuth, 'logout');

component.igxDropDown.open();
component.igxDropDown.setSelectedItem(0);
Expand Down
Loading
Loading