Added user change status try catch, implement logout. password change admin
This commit is contained in:
@@ -18,17 +18,19 @@ public class OAuth2Controller : Controller
|
||||
private readonly DiscordOAuth2Service DiscordOAuth2Service;
|
||||
private readonly UserRepository UserRepository;
|
||||
private readonly UserService UserService;
|
||||
private readonly DateTimeService DateTimeService;
|
||||
|
||||
public OAuth2Controller(
|
||||
GoogleOAuth2Service googleOAuth2Service,
|
||||
UserRepository userRepository,
|
||||
UserService userService,
|
||||
DiscordOAuth2Service discordOAuth2Service)
|
||||
DiscordOAuth2Service discordOAuth2Service, DateTimeService dateTimeService)
|
||||
{
|
||||
GoogleOAuth2Service = googleOAuth2Service;
|
||||
UserRepository = userRepository;
|
||||
UserService = userService;
|
||||
DiscordOAuth2Service = discordOAuth2Service;
|
||||
DateTimeService = dateTimeService;
|
||||
}
|
||||
|
||||
[HttpGet("google")]
|
||||
@@ -63,7 +65,7 @@ public class OAuth2Controller : Controller
|
||||
|
||||
Response.Cookies.Append("token", token, new ()
|
||||
{
|
||||
Expires = new DateTimeOffset(DateTime.UtcNow.AddDays(10))
|
||||
Expires = new DateTimeOffset(DateTimeService.GetCurrent().AddDays(10))
|
||||
});
|
||||
|
||||
return Redirect("/");
|
||||
@@ -121,7 +123,7 @@ public class OAuth2Controller : Controller
|
||||
|
||||
Response.Cookies.Append("token", token, new ()
|
||||
{
|
||||
Expires = new DateTimeOffset(DateTime.UtcNow.AddDays(10))
|
||||
Expires = new DateTimeOffset(DateTimeService.GetCurrent().AddDays(10))
|
||||
});
|
||||
|
||||
return Redirect("/");
|
||||
|
||||
Reference in New Issue
Block a user