Added refresh token endpoint

This commit is contained in:
Filip Izydorczyk
2020-12-23 11:51:17 +01:00
parent 7f630ccdac
commit 61c5a43192
7 changed files with 45 additions and 11 deletions

View File

@ -1,22 +1,17 @@
package com.plannaplan.services;
import org.springframework.beans.factory.annotation.Autowired;
// import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
@Service
public class EventService {
@Autowired
private EmailService emailService;
// @Autowired
// private EmailService emailService;
@Scheduled(cron = "0 2 17 * * *")
public void collectGroupLosses() {
System.out.println("Checking for groups");
}
@Scheduled(cron = "0 5 18 * * *")
public void testMail() {
this.emailService.sendMail("kaczor982@gmail.com", "Cześć. Jestem Tomek.");
}
}

View File

@ -81,4 +81,8 @@ public class UserService {
return this.repo.getAllByRole(UserRoles.STUDENT);
}
public Optional<User> getUserByRefreshToken(String refreshToken) {
return this.repo.getByRefreshToken(refreshToken);
}
}