Added forbiden urls and protected

This commit is contained in:
Filip Izydorczyk
2020-09-14 14:02:05 +02:00
parent 478ea27480
commit 82c4c9d0fe
6 changed files with 225 additions and 0 deletions

View File

@ -11,4 +11,7 @@ import org.springframework.stereotype.Repository;
public interface UserRepository extends JpaRepository<User, Long> {
@Query("FROM User WHERE email = ?1")
User getByAuthority(@Param("authority") String authority);
@Query("FROM User WHERE token = ?1")
User getByToken(@Param("token") String token);
}

View File

@ -38,4 +38,8 @@ public class UserService extends EventWatcher {
return this.repo.getByAuthority(email.replace("\n", "").trim());
}
public User getByToken(String token) {
return this.repo.getByToken(token);
}
}