enabled xsrf be default and remove claim prefix to reduce size

This commit is contained in:
Sebastian Sdorra
2017-01-14 18:26:11 +01:00
parent 7d6d23b04d
commit 76384de26f
3 changed files with 3 additions and 3 deletions

View File

@@ -734,5 +734,5 @@ public class ScmConfiguration
* @since 1.47 * @since 1.47
*/ */
@XmlElement(name = "xsrf-protection") @XmlElement(name = "xsrf-protection")
private boolean enabledXsrfProtection = false; private boolean enabledXsrfProtection = true;
} }

View File

@@ -40,7 +40,7 @@ public final class Xsrf {
static final String HEADER_KEY = "X-XSRF-Token"; static final String HEADER_KEY = "X-XSRF-Token";
static final String CLAIMS_KEY = "scm-manager.org/xsrf"; static final String CLAIMS_KEY = "xsrf";
private Xsrf() { private Xsrf() {
} }

View File

@@ -39,7 +39,7 @@ Sonia.security.getXsrfToken = function() {
tokenClaimsCompressed = tokenClaimsCompressed.replace('-', '+').replace('_', '/'); tokenClaimsCompressed = tokenClaimsCompressed.replace('-', '+').replace('_', '/');
if (window.atob) { if (window.atob) {
var token = Ext.util.JSON.decode(window.atob(tokenClaimsCompressed)); var token = Ext.util.JSON.decode(window.atob(tokenClaimsCompressed));
return token['scm-manager.org/xsrf']; return token['xsrf'];
} else if (debug) { } else if (debug) {
console.log('ERROR: browser does not support window.atob'); console.log('ERROR: browser does not support window.atob');
} }