@@ -1530,7 +1530,7 @@ function initU2FAuth() {
1530
1530
}
1531
1531
u2fApi . ensureSupport ( )
1532
1532
. then ( function ( ) {
1533
- $ . getJSON ( '/user/u2f/challenge' ) . success ( function ( req ) {
1533
+ $ . getJSON ( suburl + '/user/u2f/challenge' ) . success ( function ( req ) {
1534
1534
u2fApi . sign ( req . appId , req . challenge , req . registeredKeys , 30 )
1535
1535
. then ( u2fSigned )
1536
1536
. catch ( function ( err ) {
@@ -1543,16 +1543,16 @@ function initU2FAuth() {
1543
1543
} ) ;
1544
1544
} ) . catch ( function ( ) {
1545
1545
// Fallback in case browser do not support U2F
1546
- window . location . href = "/user/two_factor"
1546
+ window . location . href = suburl + "/user/two_factor"
1547
1547
} )
1548
1548
}
1549
1549
function u2fSigned ( resp ) {
1550
1550
$ . ajax ( {
1551
- url :'/user/u2f/sign' ,
1552
- type :"POST" ,
1551
+ url : suburl + '/user/u2f/sign' ,
1552
+ type : "POST" ,
1553
1553
headers : { "X-Csrf-Token" : csrf } ,
1554
1554
data : JSON . stringify ( resp ) ,
1555
- contentType :"application/json; charset=utf-8" ,
1555
+ contentType : "application/json; charset=utf-8" ,
1556
1556
} ) . done ( function ( res ) {
1557
1557
window . location . replace ( res ) ;
1558
1558
} ) . fail ( function ( xhr , textStatus ) {
@@ -1565,11 +1565,11 @@ function u2fRegistered(resp) {
1565
1565
return ;
1566
1566
}
1567
1567
$ . ajax ( {
1568
- url :'/user/settings/security/u2f/register' ,
1569
- type :"POST" ,
1568
+ url : suburl + '/user/settings/security/u2f/register' ,
1569
+ type : "POST" ,
1570
1570
headers : { "X-Csrf-Token" : csrf } ,
1571
1571
data : JSON . stringify ( resp ) ,
1572
- contentType :"application/json; charset=utf-8" ,
1572
+ contentType : "application/json; charset=utf-8" ,
1573
1573
success : function ( ) {
1574
1574
window . location . reload ( ) ;
1575
1575
} ,
@@ -1623,7 +1623,7 @@ function initU2FRegister() {
1623
1623
}
1624
1624
1625
1625
function u2fRegisterRequest ( ) {
1626
- $ . post ( "/user/settings/security/u2f/request_register" , {
1626
+ $ . post ( suburl + "/user/settings/security/u2f/request_register" , {
1627
1627
"_csrf" : csrf ,
1628
1628
"name" : $ ( '#nickname' ) . val ( )
1629
1629
} ) . success ( function ( req ) {
0 commit comments