diff --git a/src/main/java/io/hexlet/typoreporter/config/SecurityConfig.java b/src/main/java/io/hexlet/typoreporter/config/SecurityConfig.java index 9456b6bf..d37278a0 100644 --- a/src/main/java/io/hexlet/typoreporter/config/SecurityConfig.java +++ b/src/main/java/io/hexlet/typoreporter/config/SecurityConfig.java @@ -21,6 +21,8 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.NoOpPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.oauth2.client.registration.ClientRegistration; +import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.access.AccessDeniedHandler; import org.springframework.security.web.authentication.AuthenticationSuccessHandler; @@ -123,6 +125,16 @@ public SecurityFilterChain filterChain(HttpSecurity http, return http.build(); } + @Bean + public ClientRegistrationRepository getClientRegistrationRepository() { + return new ClientRegistrationRepository() { + @Override + public ClientRegistration findByRegistrationId(String registrationId) { + return null; + } + }; + } + @Bean public AuthenticationSuccessHandler getOAuth2SuccessHandler() { return new OAuth2SuccessHandler(); diff --git a/src/main/resources/messages_en.properties b/src/main/resources/messages_en.properties index 892b32df..25ea845a 100644 --- a/src/main/resources/messages_en.properties +++ b/src/main/resources/messages_en.properties @@ -104,3 +104,4 @@ btn.delete-from-wks=Delete from workspace alert.password-wrong-format=Password must be between 8 and 20 characters \ and contain only latin letters, digits and symbols ~`!@#$%^&*()_-+={[}]|\:;"'<,>.?/ +link.sign-in-with-github=Sign in with GitHub diff --git a/src/main/resources/messages_ru.properties b/src/main/resources/messages_ru.properties index 65312c97..a9fa54d3 100644 --- a/src/main/resources/messages_ru.properties +++ b/src/main/resources/messages_ru.properties @@ -102,3 +102,4 @@ text.wks-delete-confirm=Удалить пространство? alert.password-wrong-format=Пароль должен быть от 8 до 20 символов\ \ и содержать только буквы латинского алфавита,\ \ цифры и символы ~`!@#$%^&*()_-+={[}]|\:;"'<,>.?/ +link.sign-in-with-github=Войти с помощью: GitHub diff --git a/src/main/resources/templates/login.html b/src/main/resources/templates/login.html index c95aad60..86781e54 100644 --- a/src/main/resources/templates/login.html +++ b/src/main/resources/templates/login.html @@ -22,13 +22,12 @@ -
- With GitHub: click here -
+
+