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 public class ApplicationUser : IdentityUser
{ {
[PersonalData]
public bool SpotifyIsLinked { get; set; } public bool SpotifyIsLinked { get; set; }
[PersonalData]
public DateTime SpotifyLastRefresh { get; set; } public DateTime SpotifyLastRefresh { get; set; }
public int SpotifyTokenExpiry { get; set; } public int SpotifyTokenExpiry { get; set; }
public string SpotifyAccessToken { get; set; } public string SpotifyAccessToken { get; set; }
public string SpotifyRefreshToken { get; set; } public string SpotifyRefreshToken { get; set; }
[PersonalData]
public string LastFmUsername { get; set; } public string LastFmUsername { get; set; }
[PersonalData]
public bool SaveScrobbles { get; set; } public bool SaveScrobbles { get; set; }
public List<Watcher> Watchers { get; set; } public List<Watcher> Watchers { get; set; }

View File

@ -15,11 +15,6 @@
<label asp-for="Username"></label> <label asp-for="Username"></label>
<input asp-for="Username" class="form-control" disabled /> <input asp-for="Username" class="form-control" disabled />
</div> </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> <button id="update-profile-button" type="submit" class="btn btn-primary form-element">Save</button>
</form> </form>
</div> </div>

View File

@ -35,21 +35,18 @@ namespace Selector.Web.Areas.Identity.Pages.Account.Manage
public class InputModel public class InputModel
{ {
[Phone]
[Display(Name = "Phone number")]
public string PhoneNumber { get; set; }
} }
private async Task LoadAsync(ApplicationUser user) private async Task LoadAsync(ApplicationUser user)
{ {
var userName = await _userManager.GetUserNameAsync(user); var userName = await _userManager.GetUserNameAsync(user);
var phoneNumber = await _userManager.GetPhoneNumberAsync(user);
Username = userName; Username = userName;
Input = new InputModel Input = new InputModel
{ {
PhoneNumber = phoneNumber
}; };
} }
@ -79,17 +76,6 @@ namespace Selector.Web.Areas.Identity.Pages.Account.Manage
return Page(); 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); await _signInManager.RefreshSignInAsync(user);
StatusMessage = "Your profile has been updated"; StatusMessage = "Your profile has been updated";
return RedirectToPage(); return RedirectToPage();

View File

@ -34,21 +34,16 @@
</form> </form>
</div> </div>
<div class="col-md-6 col-md-offset-2"> <div class="col-md-6 col-md-offset-2">
<section>
<h4>Use another service to register.</h4>
<hr />
@{ @{
if ((Model.ExternalLogins?.Count ?? 0) == 0) 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 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"> <form id="external-account" asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" method="post" class="form-horizontal">
<div> <div>
<p> <p>
@ -59,9 +54,9 @@
</p> </p>
</div> </div>
</form> </form>
}
}
</section> </section>
}
}
</div> </div>
</div> </div>

View File

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

View File

@ -5,4 +5,12 @@
} }
<h1>@ViewData["Title"]</h1> <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"> <li class="nav-item">
<a class="nav-link" asp-area="" asp-page="/Past">Past</a> <a class="nav-link" asp-area="" asp-page="/Past">Past</a>
</li> </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> </ul>
@*</div>*@ @*</div>*@
<partial name="_LoginPartial" /> <partial name="_LoginPartial" />
@ -37,7 +43,7 @@
&copy; 2021 - Selector.Web - <a asp-area="" asp-page="/Privacy">Privacy</a> &copy; 2021 - Selector.Web - <a asp-area="" asp-page="/Privacy">Privacy</a>
</div> </div>
<div style="text-align: center"> <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" <img src="/andy.png"
alt="AP" alt="AP"
width="120px" width="120px"

View File

@ -19,10 +19,10 @@
else else
{ {
<li class="nav-item"> <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>
<li class="nav-item"> <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> </li>
} }
</ul> </ul>

View File

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