use of com.paascloud.security.app.AppSecretException in project paascloud-master by paascloud.
the class AppSingUpUtils method doPostSignUp.
/**
* 将缓存的社交网站用户信息与系统注册用户信息绑定
*
* @param request the request
* @param userId the user id
*/
public void doPostSignUp(WebRequest request, String userId) {
String key = getKey(request);
if (!redisTemplate.hasKey(key)) {
throw new AppSecretException("无法找到缓存的用户社交账号信息");
}
ConnectionData connectionData = (ConnectionData) redisTemplate.opsForValue().get(key);
Connection<?> connection = connectionFactoryLocator.getConnectionFactory(connectionData.getProviderId()).createConnection(connectionData);
usersConnectionRepository.createConnectionRepository(userId).addConnection(connection);
redisTemplate.delete(key);
}
Aggregations