Adding helper for auth key resolution
This commit is contained in:
parent
bee026efd8
commit
5c802c8e4e
12
src/helpers/index.js
Normal file
12
src/helpers/index.js
Normal file
@ -0,0 +1,12 @@
|
||||
export function getAuthKeyFromProperties(props) {
|
||||
var authKey;
|
||||
|
||||
if (props.sessionIdentifier && props.sessionIdentifier.length > 0) {
|
||||
authKey = props.sessionIdentifier;
|
||||
} else if (props.username && props.username.length > 0) {
|
||||
authKey = props.username;
|
||||
} else {
|
||||
throw new Error('_sessionIdentifier or username properties not found (check query params)');
|
||||
}
|
||||
return authKey
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user