Package edu.ucsb.cs156.organic.services
Class CurrentUserServiceImpl
java.lang.Object
edu.ucsb.cs156.organic.services.CurrentUserService
edu.ucsb.cs156.organic.services.CurrentUserServiceImpl
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetOAuth2AuthenticatedUser
(org.springframework.security.core.context.SecurityContext securityContext, org.springframework.security.core.Authentication authentication) Get the currently logged in user, or null if no user is logged in.Collection<? extends org.springframework.security.core.GrantedAuthority>
getRoles()
getUser()
Get the currently logged in user, or null if no user is logged in.void
updateToken
(User user) void
updateUserFromGithubAPI
(User user)
-
Constructor Details
-
CurrentUserServiceImpl
public CurrentUserServiceImpl()
-
-
Method Details
-
getCurrentUser
- Specified by:
getCurrentUser
in classCurrentUserService
-
getUser
Get the currently logged in user, or null if no user is logged in.- Specified by:
getUser
in classCurrentUserService
-
getOAuth2AuthenticatedUser
public User getOAuth2AuthenticatedUser(org.springframework.security.core.context.SecurityContext securityContext, org.springframework.security.core.Authentication authentication) Get the currently logged in user, or null if no user is logged in.- Parameters:
securityContext
-authentication
-- Returns:
-
getRoles
- Specified by:
getRoles
in classCurrentUserService
-
updateToken
-
updateUserFromGithubAPI
-