@@ -721,8 +721,8 @@ export default class Formio {
721
721
722
722
// Allow plugins to alter the options.
723
723
options = Formio . pluginAlter ( 'requestOptions' , options , url ) ;
724
- if ( options . namespace ) {
725
- opts . namespace = options . namespace ;
724
+ if ( options . namespace || Formio . namespace ) {
725
+ opts . namespace = options . namespace || Formio . namespace ;
726
726
}
727
727
728
728
const requestToken = options . headers . get ( 'x-jwt-token' ) ;
@@ -879,7 +879,7 @@ export default class Formio {
879
879
880
880
static setToken ( token = '' , opts ) {
881
881
opts = ( typeof opts === 'string' ) ? { namespace : opts } : opts || { } ;
882
- var tokenName = `${ opts . namespace || 'formio' } Token` ;
882
+ var tokenName = `${ opts . namespace || Formio . namespace || 'formio' } Token` ;
883
883
if ( ! Formio . tokens ) {
884
884
Formio . tokens = { } ;
885
885
}
@@ -911,7 +911,7 @@ export default class Formio {
911
911
912
912
static getToken ( options ) {
913
913
options = ( typeof options === 'string' ) ? { namespace : options } : options || { } ;
914
- var tokenName = `${ options . namespace || 'formio' } Token` ;
914
+ var tokenName = `${ options . namespace || Formio . namespace || 'formio' } Token` ;
915
915
if ( ! Formio . tokens ) {
916
916
Formio . tokens = { } ;
917
917
}
@@ -930,7 +930,7 @@ export default class Formio {
930
930
}
931
931
932
932
static setUser ( user , opts = { } ) {
933
- var userName = `${ opts . namespace || 'formio' } User` ;
933
+ var userName = `${ opts . namespace || Formio . namespace || 'formio' } User` ;
934
934
if ( ! user ) {
935
935
Formio . setToken ( null , opts ) ;
936
936
// iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.
@@ -952,7 +952,7 @@ export default class Formio {
952
952
953
953
static getUser ( options ) {
954
954
options = options || { } ;
955
- var userName = `${ options . namespace || 'formio' } User` ;
955
+ var userName = `${ options . namespace || Formio . namespace || 'formio' } User` ;
956
956
try {
957
957
return JSON . parse ( localStorage . getItem ( userName ) || null ) ;
958
958
}
0 commit comments