mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-22 15:25:49 +00:00
change social buttons
This commit is contained in:
parent
f5c0430bbb
commit
824bd0d209
2 changed files with 11 additions and 7 deletions
|
@ -159,7 +159,7 @@ public class UserController extends WebSocketSender {
|
|||
String firstName;
|
||||
String lastName;
|
||||
String email;
|
||||
String providerId;
|
||||
String providerId = "";
|
||||
String provider = authentication.getAuthorizedClientRegistrationId();
|
||||
|
||||
if (provider.equals(CommonAttribute.GOOGLE)) {
|
||||
|
@ -170,10 +170,14 @@ public class UserController extends WebSocketSender {
|
|||
else {
|
||||
firstName = authentication.getPrincipal().getAttribute(CommonAttribute.GITHUB_FIRSTNAME);
|
||||
lastName = authentication.getPrincipal().getAttribute(CommonAttribute.GITHUB_LASTNAME);
|
||||
providerId = String.valueOf(authentication.getPrincipal().getAttribute(CommonAttribute.GITHUB_PROVIDER_ID));
|
||||
try {
|
||||
providerId = authentication.getPrincipal().getAttribute(CommonAttribute.GITHUB_PROVIDER_ID).toString();
|
||||
} catch (NullPointerException exception) {
|
||||
log.error("Cast integer to string ",exception);
|
||||
}
|
||||
}
|
||||
|
||||
email = authentication.getPrincipal().getAttribute("email");
|
||||
email = authentication.getPrincipal().getAttribute(CommonAttribute.EMAIL);
|
||||
|
||||
CredentialDTO credential = credentialService.findByAuthentication(authentication);
|
||||
|
||||
|
|
|
@ -30,14 +30,14 @@
|
|||
|
||||
<h2 style="text-align:center">Login with Social Media</h2>
|
||||
|
||||
<div class="col-md-12 " th:each="url : ${urls}" style="text-align:center">
|
||||
<a th:if="${url.key == 'Google'}" th:href="${url.value}" class="btn btn-bloc btn-social btn-lg" style="background-color: #dd4b39">
|
||||
<div class="col-md-12 " th:each="url : ${urls}" style="text-align:center; margin-bottom: 10px">
|
||||
<a th:if="${url.key == 'Google'}" th:href="${url.value}" class="btn btn-bloc btn-social btn-lg" style="width:250px; background-color: #dd4b39">
|
||||
<i class="fa fa-google fa-fw"></i> Login with Google
|
||||
</a>
|
||||
<a th:if="${url.key == 'GitHub'}" th:href="${url.value}" class="btn btn-bloc btn-social btn-lg" style="background-color: black">
|
||||
<a th:if="${url.key == 'GitHub'}" th:href="${url.value}" class="btn btn-bloc btn-social btn-lg" style="width:250px; background-color: black">
|
||||
<i class="fa fa-github fa-fw"></i> Login with Github
|
||||
</a>
|
||||
<a th:if="${url.key == 'Facebook'}" th:href="${url.value}" class="btn btn-bloc btn-social btn-lg" style="background-color: #3B5998">
|
||||
<a th:if="${url.key == 'Facebook'}" th:href="${url.value}" class="btn btn-bloc btn-social btn-lg" style="width:250px; background-color: #3B5998">
|
||||
<i class="fa fa-facebook fa-fw"></i> Login with Facebook
|
||||
</a>
|
||||
|
||||
|
|
Loading…
Reference in a new issue