Merge branch 'master' into past

This commit is contained in:
andy 2022-11-13 22:12:49 +00:00 committed by GitHub
commit b6d5e94280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 46 additions and 50 deletions

View File

@ -8,13 +8,17 @@ namespace Selector.Model
{
public class ApplicationUser : IdentityUser
{
[PersonalData]
public bool SpotifyIsLinked { get; set; }
[PersonalData]
public DateTime SpotifyLastRefresh { get; set; }
public int SpotifyTokenExpiry { get; set; }
public string SpotifyAccessToken { get; set; }
public string SpotifyRefreshToken { get; set; }
[PersonalData]
public string LastFmUsername { get; set; }
[PersonalData]
public bool SaveScrobbles { get; set; }
public List<Watcher> Watchers { get; set; }

View File

@ -15,11 +15,6 @@
<label asp-for="Username"></label>
<input asp-for="Username" class="form-control" disabled />
</div>
<div class="form-group form-element">
<label asp-for="Input.PhoneNumber"></label>
<input asp-for="Input.PhoneNumber" class="form-control" />
<span asp-validation-for="Input.PhoneNumber" class="text-danger"></span>
</div>
<button id="update-profile-button" type="submit" class="btn btn-primary form-element">Save</button>
</form>
</div>

View File

@ -35,21 +35,18 @@ namespace Selector.Web.Areas.Identity.Pages.Account.Manage
public class InputModel
{
[Phone]
[Display(Name = "Phone number")]
public string PhoneNumber { get; set; }
}
private async Task LoadAsync(ApplicationUser user)
{
var userName = await _userManager.GetUserNameAsync(user);
var phoneNumber = await _userManager.GetPhoneNumberAsync(user);
Username = userName;
Input = new InputModel
{
PhoneNumber = phoneNumber
};
}
@ -79,17 +76,6 @@ namespace Selector.Web.Areas.Identity.Pages.Account.Manage
return Page();
}
var phoneNumber = await _userManager.GetPhoneNumberAsync(user);
if (Input.PhoneNumber != phoneNumber)
{
var setPhoneResult = await _userManager.SetPhoneNumberAsync(user, Input.PhoneNumber);
if (!setPhoneResult.Succeeded)
{
StatusMessage = "Unexpected error when trying to set phone number.";
return RedirectToPage();
}
}
await _signInManager.RefreshSignInAsync(user);
StatusMessage = "Your profile has been updated";
return RedirectToPage();

View File

@ -34,21 +34,16 @@
</form>
</div>
<div class="col-md-6 col-md-offset-2">
<section>
<h4>Use another service to register.</h4>
<hr />
@{
if ((Model.ExternalLogins?.Count ?? 0) == 0)
{
<div>
<p>
There are no external authentication services configured. See <a href="https://go.microsoft.com/fwlink/?LinkID=532715">this article</a>
for details on setting up this ASP.NET application to support logging in via external services.
</p>
</div>
}
else
{
<section>
<h4>Use another service to register.</h4>
<hr />
<form id="external-account" asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" method="post" class="form-horizontal">
<div>
<p>
@ -59,9 +54,9 @@
</p>
</div>
</form>
}
}
</section>
}
}
</div>
</div>

View File

@ -31,8 +31,10 @@ $shadow-color: #1e1e1e;
.chart-card {
// width: 500px;
width: 100%;
max-width: max-content;
margin-top: 10px;
margin-bottom: 10px;
// width: 100%;
// max-width: max-content;
}
@media only screen and (min-width: 768px) {
@ -50,10 +52,6 @@ $shadow-color: #1e1e1e;
width: 250px;
}
.chart-card {
width: 500px;
}
}
@media only screen and (min-width: 768px) {
@ -61,6 +59,10 @@ $shadow-color: #1e1e1e;
min-width: 200px;
max-width: 500px;
}
.chart-card {
width: 500px;
}
}
.spotify-logo {

View File

@ -5,4 +5,12 @@
}
<h1>@ViewData["Title"]</h1>
<p>Use this page to detail your site's privacy policy.</p>
<p>Selector is a side project that I don't/won't/can't monetise. No extra personal information is stored and all information can be deleted whenever you like. Your credentials are a username, email and password only, I dont want your name/phone number. No analytics/ad libraries are used.</p>
<p>Selector relies on a link to your Spotify account in order to see what you're listening to and respond. When you link your Spotify account, Selector is provided with a key that it can use to make requests of Spotify. You can unlink Spotify from the Selector settings, doing so clears all stored Spotify credentials, completely removing Selector's ability to access your Spotify account. If and when you would like to prevent Selector's access to your Spotify account, you can also revoke Selector's access from your <a href="https://www.spotify.com/uk/account/apps/">Spotify account settings</a>.</p>
<p>Selector also has Last.fm integrations, enabled by providing your username in the Selector settings page. Selector only uses publicly available Last.fm data, no authentication with Last.fm is required and removing the username from Selectors settings disables the integration.</p>
<p>You can manage your personal data <a href="/Identity/Account/Manage/PersonalData">here</a>. From this page you can download or delete your data.</p>
<p>If you have any questions or concerns about your data, you can contact me using the form on <a href="https://sarsoo.xyz/about">sarsoo.xyz</a>.</p>

View File

@ -20,6 +20,12 @@
<li class="nav-item">
<a class="nav-link" asp-area="" asp-page="/Past">Past</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://sarsoo.xyz/posts/selector/">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://sarsoo.xyz/about">Contact</a>
</li>
</ul>
@*</div>*@
<partial name="_LoginPartial" />
@ -37,7 +43,7 @@
&copy; 2021 - Selector.Web - <a asp-area="" asp-page="/Privacy">Privacy</a>
</div>
<div style="text-align: center">
<a href="https://sarsoo.xyz/selector/" style="display: inline-block">
<a href="https://sarsoo.xyz/about/" style="display: inline-block">
<img src="/andy.png"
alt="AP"
width="120px"

View File

@ -19,10 +19,10 @@
else
{
<li class="nav-item">
<a class="nav-link text-dark" id="register" asp-area="Identity" asp-page="/Account/Register">Register</a>
<a class="nav-link text-light" id="register" asp-area="Identity" asp-page="/Account/Register">Register</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" id="login" asp-area="Identity" asp-page="/Account/Login">Login</a>
<a class="nav-link text-light" id="login" asp-area="Identity" asp-page="/Account/Login">Login</a>
</li>
}
</ul>

View File

@ -28,7 +28,7 @@ export let PlayCountChartCard: Vue.Component = {
},
template:
`
<div class="card info-card chart-card">
<div class="chart-card card">
<h1>{{ title }}</h1>
<canvas :id="chartId"></canvas>
<lastfm-logo :link="link" v-if="link" />
@ -89,7 +89,7 @@ export let CombinedPlayCountChartCard: Vue.Component = {
},
template:
`
<div class="card info-card chart-card">
<div class="chart-card card">
<canvas :id="chartId"></canvas>
<lastfm-logo :link="link" />
</div>