API: add OC_API::checkLoggedIn()
This commit is contained in:
parent
75dbed2208
commit
2afe5f9b2b
11
lib/api.php
11
lib/api.php
|
@ -121,4 +121,15 @@ class OC_API {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check if the user is authenticated
|
||||||
|
*/
|
||||||
|
public static function checkLoggedIn(){
|
||||||
|
// Check OAuth
|
||||||
|
if(!OC_OAuth::isAuthorised()){
|
||||||
|
OC_Response::setStatus(401);
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue