This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.eco.security; | |
| // Imports | |
| public class PasswordUtils { | |
| @Autowired | |
| private static BCryptPasswordEncoder encoder; | |
| public static String generateBCrypt(String password) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.eco.security; | |
| // Imports | |
| @Repository | |
| public interface UserRepository extends JpaRepository<User, Long> { | |
| User findByUsername(String username); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE user ( | |
| id INT NOT NULL AUTO_INCREMENT, | |
| role VARCHAR(15) NOT NULL, | |
| name VARCHAR(70) NOT NULL, | |
| email VARCHAR(45) NOT NULL, | |
| username VARCHAR(11) NOT NULL, | |
| password VARCHAR(60) NOT NULL, | |
| phone VARCHAR(11) NULL, | |
| PRIMARY KEY (id)) | |
| ENGINE = InnoDB; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.eco.security; | |
| import java.io.Serializable; | |
| import javax.persistence.Entity; | |
| import javax.persistence.EnumType; | |
| import javax.persistence.Enumerated; | |
| import javax.persistence.GeneratedValue; | |
| import javax.persistence.GenerationType; | |
| import javax.persistence.Id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.eco.security; | |
| import java.util.Date; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| import org.springframework.beans.factory.annotation.Value; | |
| import org.springframework.security.core.userdetails.UserDetails; | |
| import org.springframework.stereotype.Component; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.eco.security; | |
| public enum Profile { | |
| ROLE_ADMIN, ROLE_PATIENT, ROLE_DOCTOR; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Configurando conexão com o MySQL | |
| spring.jpa.hibernate.ddl-auto=none | |
| spring.datasource.url=jdbc:mysql://localhost:3306/eco | |
| spring.datasource.username=root | |
| spring.datasource.password=root | |
| # Configurando o JWT | |
| jwt.header=Authorization | |
| jwt.secret=1us@b0 | |
| jwt.expiration=604800 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.eco.security; | |
| import org.springframework.context.annotation.Configuration; | |
| import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | |
| import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | |
| @Configuration | |
| @EnableWebSecurity | |
| public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <link rel="stylesheet" type="text/css" href="css/jquery-ui.css"/> <!-- Link para o CSS do JQuery - Tema: Redmond --> | |
| <link rel="stylesheet" type="text/css" href="css/table.css"/> <!-- Link para o CSS das Tabelas --> | |
| <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script> <!-- Link para o script principal do JQuery --> | |
| <script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script> <!-- Link para o script do JQuery UI --> | |
| <script type="text/javascript" src="js/jquery.maskedinput-1.3.min.js"></script> <!-- Link para o script do JQuery UI --> | |
| <style> | |
| body { | |
| width: 80%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var TwitterReader = new Ext.data.JsonReader({ | |
| idProperty: 'id', | |
| root: 'users', | |
| totalProperty: 'results', | |
| fields: [ | |
| {name: 'description', mapping: 'description'}, | |
| {name: 'profile_image_url', mapping: 'profile_image_url'}, | |
| {name: 'name', mapping: 'name'}, | |
| {name: 'screen_name', mapping: 'screen_name'} | |
| ] |
NewerOlder