Skip to content

Test #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
package org.saleban.admin.repository;

import org.saleban.admin.domain.User;

import org.saleban.admin.domain.security.PasswordResetToken;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.stream.Stream;

@Repository
public interface PasswordResetTokenRepository extends JpaRepository<PasswordResetToken, Long> {

PasswordResetToken findByToken(String token);
PasswordResetToken findByUser(User user);

Stream<PasswordResetToken> findAllByExpiryDateLessThan(Date now);

@Modifying
@Query("delete from PasswordResetToken t where t.expiryDate <= ?1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public User findByEmail(String email) {
}

@Override
public User createUser(User user, Set<UserRole> userRoles) throws Exception{
public User createUser(User user, Set<UserRole> userRoles) throws Exception {
User localUser = userRepository.findByUsername(user.getUsername());
if(localUser != null){
throw new Exception("User already exists");
Expand Down
1 change: 0 additions & 1 deletion admin/src/main/java/org/saleban/admin/util/Mappings.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ public final class Mappings {
//Constants
public static final String HOME = "/";
public static final String LOGIN = "/login";
public static final String REDIRECT = "redirect:/home";
public static final String INDEX = "/home";
public static final String LOGOUT = "/logout";
public static final String ADD_PRODUCT = "/product";
Expand Down
8 changes: 4 additions & 4 deletions admin/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
server.port = 8081
server.port = 8056
server.servlet.context-path=/admin
spring.thymeleaf.cache=false

Expand All @@ -12,9 +12,9 @@ spring.resources.static-locations[1]=classpath:/static/
spring.output.ansi.enabled=always

## database connection
spring.datasource.url = jdbc:mysql://localhost:3306/autoparts?useSSL=false
spring.datasource.username=saleban
spring.datasource.password=saleban
spring.datasource.url=jdbc:mysql://localhost:3306/ECommerceDB?serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=
spring.jpa.show-sql=true

spring.datasource.testWhileIdle=true
Expand Down
18 changes: 11 additions & 7 deletions car-parts/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
server.port = 8083
server.port = 8057

# Enable ansi output
spring.output.ansi.enabled=always
Expand All @@ -8,9 +8,9 @@ spring.thymeleaf.cache=false

#
## database connection
spring.datasource.url = jdbc:mysql://localhost:3306/autoparts?useSSL=false
spring.datasource.username=saleban
spring.datasource.password=saleban
spring.datasource.url=jdbc:mysql://localhost:3306/ECommerceDB?serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=
spring.jpa.show-sql=true

spring.datasource.testWhileIdle=true
Expand All @@ -21,13 +21,17 @@ spring.jpa.hibernate.ddl-auto=update
# Allows Hibernate to generate SQL optimized for a particular DBMS
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect




spring.mail.host=smtp.gmail.com
spring.mail.username=
spring.mail.password=
spring.mail.port=587
spring.mail.username=g.praveenvarma95@gmail.com
spring.mail.password=hicgucjkdfggkjve
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.socketFactory.port=465
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
spring.mail.properties.mail.smtp.socketFactory.failback=false
support.email=


spring.security.ignored=/products