Commit e1c0f82b authored by Matija Obreza's avatar Matija Obreza
Browse files

Using siteKey instead of privateKey to follow reCaptcha nomenclature

parent dfabd40c
......@@ -66,8 +66,8 @@ public class HtmlController extends BaseController {
@Autowired
private ContentService contentService;
@Value("${captcha.publicKey}")
private String captchaPublicKey;
@Value("${captcha.siteKey}")
private String captchaSiteKey;
@Value("${captcha.privateKey}")
private String captchaPrivateKey;
......@@ -118,7 +118,7 @@ public class HtmlController extends BaseController {
@RequestMapping(value = "registration")
public String registration(ModelMap model) {
model.addAttribute("captchaSiteKey", captchaPublicKey);
model.addAttribute("captchaSiteKey", captchaSiteKey);
model.addAttribute("blurp", contentService.getGlobalArticle("registration", getLocale()));
return "/registration";
}
......
......@@ -67,8 +67,8 @@ public class RequestController extends BaseController {
@Value("${captcha.privateKey}")
private String captchaPrivateKey;
@Value("${captcha.publicKey}")
private String captchaPublicKey;
@Value("${captcha.siteKey}")
private String captchaSiteKey;
@Autowired
private RequestService requestService;
......@@ -94,7 +94,8 @@ public class RequestController extends BaseController {
public String start(ModelMap model) {
final User currentUser = SecurityContextUtil.getCurrentUser();
model.addAttribute("blurp", contentService.getGlobalArticle("request-personal", getLocale()));
model.addAttribute("captchaPublicKey", captchaPublicKey);
model.addAttribute("captchaSiteKey", captchaSiteKey);
if (!model.containsAttribute("requestEmail") && currentUser != null) {
model.addAttribute("requestEmail", currentUser.getEmail());
}
......
......@@ -21,21 +21,17 @@ import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.genesys2.server.exception.UserException;
import org.genesys2.server.model.impl.User;
import org.genesys2.server.service.ContentService;
import org.genesys2.server.service.EMailVerificationService;
import org.genesys2.server.service.TeamService;
import org.genesys2.server.service.TokenVerificationService.NoSuchVerificationTokenException;
import org.genesys2.server.service.UserService;
import org.genesys2.spring.ResourceNotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.Validator;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
......@@ -45,30 +41,15 @@ import org.springframework.web.bind.annotation.RequestParam;
@RequestMapping("/profile")
public class UserProfileController extends BaseController {
@Autowired
private AuthenticationManager authenticationManager;
@Autowired
private UserService userService;
@Autowired
private Validator validator;
@Autowired
private TeamService teamService;
@Autowired
private ContentService contentService;
@Autowired
private EMailVerificationService emailVerificationService;
@Value("${captcha.privateKey}")
private String captchaPrivateKey;
@Value("${captcha.publicKey}")
private String captchaPublicKey;
@RequestMapping
@PreAuthorize("isAuthenticated()")
public String welcome(ModelMap model) {
......
......@@ -43,6 +43,8 @@ c3p0.maxIdleTime=10
# reCAPTCHA API: These are our keys for localhost
captcha.privateKey=6Lfb5w4TAAAAADoSaBZsxx832HH5YHdCdEiS2v0s
captcha.siteKey=${captcha.publicKey}
# Obsolete, use captcha.siteKey
captcha.publicKey=6Lfb5w4TAAAAAI6pD_4l5uIwXEaUJ6KQmhU9cyjx
# paths
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment