Skip to content

Commit

Permalink
Merge pull request #3823 from pyramidsbuilder/links-login-register-pages
Browse files Browse the repository at this point in the history
added links from login to register and vice versa
  • Loading branch information
sbwalker authored Feb 21, 2024
2 parents 838c299 + 5d64ea4 commit 956c900
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Oqtane.Client/Modules/Admin/Login/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@
<button type="button" class="btn btn-primary" @onclick="Login">@SharedLocalizer["Login"]</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">@SharedLocalizer["Cancel"]</button>
<br /><br />
<button type="button" class="btn btn-secondary" @onclick="Forgot">@Localizer["ForgotPassword"]</button>
}
<button type="button" class="btn btn-secondary" @onclick="Forgot">@Localizer["ForgotPassword"]</button>
@if (PageState.Site.AllowRegistration)
{
<br /><br />
<NavLink href="@NavigateUrl("register")">@Localizer["Register"]</NavLink>
}
}
</div>
</form>
}
Expand Down
9 changes: 8 additions & 1 deletion Oqtane.Client/Modules/Admin/Register/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
<br />
<button type="button" class="btn btn-primary" @onclick="Register">@Localizer["Register"]</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">@SharedLocalizer["Cancel"]</button>
@if (_allowsitelogin)
{
<br /><br />
<NavLink href="@NavigateUrl("login")">@Localizer["Login"]</NavLink>
}
</form>
</NotAuthorized>
</AuthorizeView>
Expand All @@ -80,12 +85,14 @@ else
private string _confirm = string.Empty;
private string _email = string.Empty;
private string _displayname = string.Empty;
private bool _allowsitelogin = true;

public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Anonymous;

protected override async Task OnInitializedAsync()
{
_passwordrequirements = await UserService.GetPasswordRequirementsAsync(PageState.Site.SiteId);
_passwordrequirements = await UserService.GetPasswordRequirementsAsync(PageState.Site.SiteId);
_allowsitelogin = bool.Parse(SettingService.GetSetting(PageState.Site.Settings, "LoginOptions:AllowSiteLogin", "true"));
}

protected override void OnParametersSet()
Expand Down
3 changes: 3 additions & 0 deletions Oqtane.Client/Resources/Modules/Admin/Login/Index.resx
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,7 @@
<data name="ExternalLoginStatus.ReviewClaims" xml:space="preserve">
<value>The Review Claims Option Was Enabled In External Login Settings. Please Visit The Event Log To View The Claims Returned By The Provider.</value>
</data>
<data name="Register" xml:space="preserve">
<value>Register as new user?</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Oqtane.Client/Resources/Modules/Admin/Register/Index.resx
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,7 @@
<data name="Username.Text" xml:space="preserve">
<value>Username:</value>
</data>
<data name="Login" xml:space="preserve">
<value>Already have account, Login?</value>
</data>
</root>

0 comments on commit 956c900

Please sign in to comment.