Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Squidex/squidex into custom_indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Nov 10, 2024
2 parents 9b6808a + 62b2133 commit 7190b62
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 91 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected].1
- uses: actions/[email protected].2
with:
token: ${{ secrets.WORKFLOW_SECRET }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Prepare - Checkout
uses: actions/[email protected].1
uses: actions/[email protected].2

- name: Prepare - Inject short Variables
uses: rlespinasse/[email protected]
Expand All @@ -28,7 +28,7 @@ jobs:
uses: docker/[email protected]

- name: Prepare - Setup Node
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version: 18

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/make-screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Prepare - Checkout
uses: actions/[email protected].1
uses: actions/[email protected].2

- name: Prepare - Setup QEMU
uses: docker/[email protected]
Expand All @@ -18,7 +18,7 @@ jobs:
uses: docker/[email protected]

- name: Prepare - Setup Node
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version: 18

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Prepare - Checkout
uses: actions/[email protected].1
uses: actions/[email protected].2

- name: Prepare - Inject short Variables
uses: rlespinasse/[email protected]
Expand All @@ -23,7 +23,7 @@ jobs:
uses: docker/[email protected]

- name: Prepare - Setup Node
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version: 18

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,8 @@ private async Task<App> GetAppAsync(DomainId appId)
{
var appProvider = serviceProvider.GetRequiredService<IAppProvider>();

var app = await appProvider.GetAppAsync(appId);

if (app == null)
{
var app = await appProvider.GetAppAsync(appId) ??
throw new JavaScriptException("App does not exist.");
}

return app;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ private async Task<IActionResult> LoginViewAsync(RequestType requestType)
var vm = new LoginVM
{
ExternalProviders = externalProviders,
IsLogin = HttpContext.Request.Query["signup"] != "true",
HasPasswordAuth = allowPasswordAuth,
HasCustomAuth = allowCustomDomains,
RequestType = requestType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ public class LoginVM

public string? Password { get; set; }

public bool IsLogin { get; set; }

public bool HasPasswordAuth { get; set; }

public bool HasCustomAuth { get; set; }
Expand Down
98 changes: 22 additions & 76 deletions backend/src/Squidex/Areas/IdentityServer/Views/Account/Login.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,10 @@
@model Squidex.Areas.IdentityServer.Controllers.Account.LoginVM

@{
var action = Model.IsLogin ? T.Get("common.login") : T.Get("common.signup");

ViewBag.Title = action;
ViewBag.Title = T.Get("common.login");
}

<div class="login-container">
<div class="container">
<div class="row text-center">
<div class="btn-group profile-headline">
@if (Model.IsLogin)
{
<a class="btn btn-toggle btn-primary">@T.Get("common.login")</a>
}
else
{
<a class="btn btn-toggle" asp-controller="Account" asp-action="Login" asp-route-returnurl="@Model.ReturnUrl">@T.Get("common.login")</a>
}

@if (!Model.IsLogin)
{
<a class="btn btn-toggle btn-primary">@T.Get("common.signup")</a>
}
else
{
<a class="btn btn-toggle" asp-controller="Account" asp-action="Login" asp-route-returnurl="@Model.ReturnUrl" asp-route-signup="true">@T.Get("common.signup")</a>
}
</div>
</div>
</div>

<div>
@if (Model.HasExternalLogin)
{
Expand All @@ -44,7 +18,7 @@

<div class="form-group mb-2">
<button class="btn external-button btn-block btn btn-@schema" type="submit" name="provider" value="@provider.AuthenticationScheme">
<i class="icon-@schema external-icon"></i> @Html.Raw(T.Get("users.login.loginWith", new { action, provider = provider.DisplayName }))
<i class="icon-@schema external-icon"></i> @Html.Raw(T.Get("users.login.loginWith", new { action = T.Get("common.login"), provider = provider.DisplayName }))
</button>
</div>
}
Expand All @@ -58,41 +32,34 @@
@if (Model.HasPasswordAuth)
{
<div>
@if (Model.IsLogin)
{
@if (Model.RequestType == RequestType.Login)
{
<div asp-validation-summary="ModelOnly" class="form-alert form-alert-error"></div>
}

<form asp-controller="Account" asp-action="Login" asp-route-returnurl="@Model.ReturnUrl" method="post">
@Html.AntiForgeryToken()

<div class="form-group">
<div error-for="Email"></div>
<input asp-for="Email" type="email" class="form-control" placeholder="@T.Get("users.login.emailPlaceholder")" />
</div>

<div class="form-group">
<div error-for="Password"></div>
<input asp-for="Password" type="password" class="form-control" placeholder="@T.Get("users.login.passwordPlaceholder")" />
</div>

<button type="submit" data-testid="login-button" class="btn btn-block btn-primary">@action</button>
</form>
}
else
@if (Model.RequestType == RequestType.Login)
{
<div class="profile-password-signup text-center">@T.Get("users.login.askAdmin")</div>
<div asp-validation-summary="ModelOnly" class="form-alert form-alert-error"></div>
}

<form asp-controller="Account" asp-action="Login" asp-route-returnurl="@Model.ReturnUrl" method="post">
@Html.AntiForgeryToken()

<div class="form-group">
<div error-for="Email"></div>
<input asp-for="Email" type="email" class="form-control" placeholder="@T.Get("users.login.emailPlaceholder")" />
</div>

<div class="form-group">
<div error-for="Password"></div>
<input asp-for="Password" type="password" class="form-control" placeholder="@T.Get("users.login.passwordPlaceholder")" />
</div>

<button type="submit" data-testid="login-button" class="btn btn-block btn-primary">@T.Get("common.login")</button>
</form>
</div>
}

<div class="profile-separator">
<div class="profile-separator-text">@T.Get("users.login.separator")</div>
</div>

@if (Model.HasCustomAuth && Model.IsLogin)
@if (Model.HasCustomAuth)
{
<div>
@if (Model.RequestType == RequestType.LoginCustom)
Expand All @@ -112,30 +79,9 @@
<input asp-for="DynamicEmail" type="email" class="form-control" placeholder="@T.Get("users.login.emailBusinessPlaceholder")" />
</div>

<button type="submit" data-testid="dynamic-button" class="btn btn-block btn-primary">@action</button>
<button type="submit" data-testid="dynamic-button" class="btn btn-block btn-primary">@T.Get("common.login")</button>
</form>
</div>
}

@if (Model.IsLogin)
{
<p class="profile-footer">
@T.Get("users.login.noAccountSignupQuestion")

<a asp-controller="Account" asp-action="Signup" asp-route-returnurl="@Model.ReturnUrl">
@T.Get("users.login.noAccountSignupAction")
</a>
</p>
}
else
{
<p class="profile-footer">
@T.Get("users.login.noAccountLoginQuestion")

<a asp-controller="Account" asp-action="Login" asp-route-returnurl="@Model.ReturnUrl">
@T.Get("users.login.noAccountLoginAction")
</a>
</p>
}
</div>
</div>
2 changes: 2 additions & 0 deletions frontend/src/app/theme/_static.scss
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ a {
.login-container {
margin-left: auto;
margin-right: auto;
margin-top: 2rem;
margin-bottom: 2rem;
max-width: 20rem;
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7190b62

Please sign in to comment.