NOTE: temp commit, started rolling back changes to auth system
Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
parent
e2ce6cbf37
commit
ce201207d4
13 changed files with 97 additions and 63 deletions
|
@ -121,7 +121,7 @@
|
|||
var cauthStateProvder = (CustomAuthenticationStateProvider)authStateProvider;
|
||||
var user = await cauthStateProvder.GetAuthenticationStateAsync();
|
||||
var usr = user.User;
|
||||
UserData foundusr = await UsersRepository.getUserByIdAsync(int.Parse(usr.Identity.Name));
|
||||
UserData foundusr = await UsersRepository.getUserByEmailRawAsync(usr.Identity.Name);
|
||||
if (foundusr.Role != "User" || comment.UserID == foundusr.UserID)
|
||||
{
|
||||
await TheManager.deleteComment(comment);
|
||||
|
@ -186,7 +186,7 @@
|
|||
var cauthStateProvder = (CustomAuthenticationStateProvider)authStateProvider;
|
||||
var user = await cauthStateProvder.GetAuthenticationStateAsync();
|
||||
var usr = user.User;
|
||||
UserData foundusr = await UsersRepository.getUserByIdAsync(int.Parse(usr.Identity.Name));
|
||||
UserData foundusr = await UsersRepository.getUserByEmailRawAsync(usr.Identity.Name);
|
||||
if (foundusr != null && (foundusr.Role != "User" || comment.UserID == foundusr.UserID))
|
||||
{
|
||||
canDel = true;
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
var cauthStateProvder = (CustomAuthenticationStateProvider)authStateProvider;
|
||||
var user = await cauthStateProvder.GetAuthenticationStateAsync();
|
||||
var usr = user.User;
|
||||
UserData foundusr = await UsersRepository.getUserByIdAsync(int.Parse(usr.Identity.Name));
|
||||
UserData foundusr = await UsersRepository.getUserByEmailRawAsync(usr.Identity.Name);
|
||||
if (foundusr == null)
|
||||
{
|
||||
hasErr = true;
|
||||
|
@ -90,7 +90,7 @@
|
|||
var cauthStateProvder = (CustomAuthenticationStateProvider)authStateProvider;
|
||||
var user = await cauthStateProvder.GetAuthenticationStateAsync();
|
||||
var usr = user.User;
|
||||
UserData foundusr = await UsersRepository.getUserByIdAsync(int.Parse(usr.Identity.Name));
|
||||
UserData foundusr = await UsersRepository.getUserByEmailRawAsync(usr.Identity.Name);
|
||||
if (foundusr == null)
|
||||
{
|
||||
hasErr = true;
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
var cauthStateProvder = (CustomAuthenticationStateProvider)authStateProvider;
|
||||
var user = await cauthStateProvder.GetAuthenticationStateAsync();
|
||||
var usr = user.User;
|
||||
UserData foundusr = await UsersRepository.getUserByIdAsync(int.Parse(usr.Identity.Name));
|
||||
UserData foundusr = await UsersRepository.getUserByEmailRawAsync(usr.Identity.Name);
|
||||
if (foundusr == null)
|
||||
{
|
||||
hasErr = true;
|
||||
|
@ -97,7 +97,7 @@
|
|||
var cauthStateProvder = (CustomAuthenticationStateProvider)authStateProvider;
|
||||
var user = await cauthStateProvder.GetAuthenticationStateAsync();
|
||||
var usr = user.User;
|
||||
UserData foundusr = await UsersRepository.getUserByIdAsync(int.Parse(usr.Identity.Name));
|
||||
UserData foundusr = await UsersRepository.getUserByEmailRawAsync(usr.Identity.Name);
|
||||
if (foundusr == null)
|
||||
{
|
||||
hasErr = true;
|
||||
|
|
|
@ -157,7 +157,7 @@
|
|||
var cauthStateProvder = (CustomAuthenticationStateProvider)authStateProvider;
|
||||
var user = await cauthStateProvder.GetAuthenticationStateAsync();
|
||||
var usr = user.User;
|
||||
UserData foundusr = await UsersRepository.getUserByIdAsync(int.Parse(usr.Identity.Name));
|
||||
UserData foundusr = await UsersRepository.getUserByEmailRawAsync(usr.Identity.Name);
|
||||
if (foundusr.Role != "User" || post.UserID == foundusr.UserID)
|
||||
{
|
||||
await TheManager.deleteThread(post);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue