diff --git a/src/Squidex/Controllers/Api/Apps/AppController.cs b/src/Squidex/Controllers/Api/Apps/AppController.cs index c7b72f9a5..e34195ab2 100644 --- a/src/Squidex/Controllers/Api/Apps/AppController.cs +++ b/src/Squidex/Controllers/Api/Apps/AppController.cs @@ -55,9 +55,9 @@ namespace Squidex.Controllers.Api.Apps { var subject = HttpContext.User.OpenIdSubject(); - var schemas = await appRepository.QueryAllAsync(subject); + var apps = await appRepository.QueryAllAsync(subject); - var response = schemas.Select(s => + var response = apps.Select(s => { var dto = SimpleMapper.Map(s, new AppDto()); diff --git a/src/Squidex/Properties/launchSettings.json b/src/Squidex/Properties/launchSettings.json index b1cd23a15..1aa5504bd 100644 --- a/src/Squidex/Properties/launchSettings.json +++ b/src/Squidex/Properties/launchSettings.json @@ -16,10 +16,8 @@ }, "Squidex": { "commandName": "Project", - "commandLineArgs": "replay", "launchUrl": "http://localhost:5000", "environmentVariables": { - "SQUIDEX__EVENTBUS__TYPE": "Memory", "ASPNETCORE_ENVIRONMENT": "Development" } } diff --git a/src/Squidex/app/app.routes.ts b/src/Squidex/app/app.routes.ts index 5ae5bbf44..284c812d1 100644 --- a/src/Squidex/app/app.routes.ts +++ b/src/Squidex/app/app.routes.ts @@ -12,6 +12,7 @@ import { AppAreaComponent, HomePageComponent, InternalAreaComponent, + LoginPageComponent, LogoutPageComponent, NotFoundPageComponent } from './shell'; @@ -61,6 +62,10 @@ export const routes: Routes = [ path: 'logout', component: LogoutPageComponent }, + { + path: 'login', + component: LoginPageComponent + }, { path: '**', component: NotFoundPageComponent diff --git a/src/Squidex/app/shell/declarations.ts b/src/Squidex/app/shell/declarations.ts index 1892dd558..73955dab7 100644 --- a/src/Squidex/app/shell/declarations.ts +++ b/src/Squidex/app/shell/declarations.ts @@ -14,6 +14,7 @@ export * from './pages/internal/apps-menu.component'; export * from './pages/internal/internal-area.component'; export * from './pages/internal/profile-menu.component'; +export * from './pages/login/login-page.component'; export * from './pages/logout/logout-page.component'; export * from './pages/not-found/not-found-page.component'; \ No newline at end of file diff --git a/src/Squidex/app/shell/module.ts b/src/Squidex/app/shell/module.ts index 55cf251a9..79b733323 100644 --- a/src/Squidex/app/shell/module.ts +++ b/src/Squidex/app/shell/module.ts @@ -15,6 +15,7 @@ import { HomePageComponent, InternalAreaComponent, LeftMenuComponent, + LoginPageComponent, LogoutPageComponent, NotFoundPageComponent, ProfileMenuComponent @@ -37,6 +38,7 @@ import { HomePageComponent, InternalAreaComponent, LeftMenuComponent, + LoginPageComponent, LogoutPageComponent, NotFoundPageComponent, ProfileMenuComponent diff --git a/src/Squidex/app/shell/pages/home/home-page.component.html b/src/Squidex/app/shell/pages/home/home-page.component.html index 3a8ace18c..0b41cdcdd 100644 --- a/src/Squidex/app/shell/pages/home/home-page.component.html +++ b/src/Squidex/app/shell/pages/home/home-page.component.html @@ -3,7 +3,7 @@ -

+

The login button will open a new popup. Once you are logged in successfull we will redirect you to the squidex management portal.

diff --git a/src/Squidex/app/shell/pages/home/home-page.component.ts b/src/Squidex/app/shell/pages/home/home-page.component.ts index aed4dcbdf..82013611e 100644 --- a/src/Squidex/app/shell/pages/home/home-page.component.ts +++ b/src/Squidex/app/shell/pages/home/home-page.component.ts @@ -25,11 +25,21 @@ export class HomePageComponent { } public login() { - this.auth.loginPopup() - .subscribe(() => { - this.router.navigate(['/app']); - }, ex => { - this.showLoginError = true; - }); + if (this.isIE()) { + this.auth.loginRedirect(); + } else { + this.auth.loginPopup() + .subscribe(() => { + this.router.navigate(['/app']); + }, ex => { + this.showLoginError = true; + }); + } + } + + public isIE() { + const isIE = !!navigator.userAgent.match(/Trident/g) || !!navigator.userAgent.match(/MSIE/g); + + return isIE; } } \ No newline at end of file diff --git a/src/Squidex/app/shell/pages/login/login-page.component.ts b/src/Squidex/app/shell/pages/login/login-page.component.ts new file mode 100644 index 000000000..2aa92c2db --- /dev/null +++ b/src/Squidex/app/shell/pages/login/login-page.component.ts @@ -0,0 +1,34 @@ +/* + * Squidex Headless CMS + * + * @license + * Copyright (c) Sebastian Stehle. All rights reserved + */ + +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; + +import { AuthService } from 'shared'; + +@Component({ + selector: 'sqx-login', + template: '' +}) +export class LoginPageComponent implements OnInit { + constructor( + private readonly auth: AuthService, + private readonly router: Router + ) { + } + + public ngOnInit() { + this.auth.loginRedirectComplete().subscribe( + () => { + this.router.navigate(['/app'], { replaceUrl: true }); + }, + () => { + this.router.navigate(['/'], { replaceUrl: true }); + } + ); + } +} \ No newline at end of file diff --git a/src/Squidex/app/shell/pages/logout/logout-page.component.ts b/src/Squidex/app/shell/pages/logout/logout-page.component.ts index 5fcfe7533..d189f4e5c 100644 --- a/src/Squidex/app/shell/pages/logout/logout-page.component.ts +++ b/src/Squidex/app/shell/pages/logout/logout-page.component.ts @@ -11,7 +11,7 @@ import { Router } from '@angular/router'; import { AuthService } from 'shared'; @Component({ - selector: 'logout', + selector: 'sqx-logout', template: '' }) export class LogoutPageComponent implements OnInit { diff --git a/src/Squidex/app/theme/_panels.scss b/src/Squidex/app/theme/_panels.scss index f2ef909e0..fdd2df83c 100644 --- a/src/Squidex/app/theme/_panels.scss +++ b/src/Squidex/app/theme/_panels.scss @@ -56,6 +56,7 @@ @include flex-box; @include flex-flow(row); @include flex-grow(1); + overflow: hidden; } &-content { diff --git a/src/Squidex/wwwroot/index.html b/src/Squidex/wwwroot/index.html index 860477658..ca9f277ba 100644 --- a/src/Squidex/wwwroot/index.html +++ b/src/Squidex/wwwroot/index.html @@ -7,7 +7,7 @@ - + + + + +