a null token has no scopes
This commit is contained in:
@@ -13,6 +13,9 @@ function getTwurpleProxy(token){
|
|||||||
* @param {...string} scopes
|
* @param {...string} scopes
|
||||||
*/
|
*/
|
||||||
function hasScopes(token,...scopes){
|
function hasScopes(token,...scopes){
|
||||||
|
if(!token){
|
||||||
|
return false
|
||||||
|
}
|
||||||
for(const scope of scopes){
|
for(const scope of scopes){
|
||||||
if(!token.scope.includes(scope)){
|
if(!token.scope.includes(scope)){
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user