Fixup oauth to not allow simple auth clients

This commit is contained in:
Johannes Zellner
2015-10-16 11:27:42 +02:00
parent 5bc9f9e995
commit 0c0782ccd7

View File

@@ -208,6 +208,7 @@ function loginForm(req, res) {
switch (result.type) {
case clientdb.TYPE_ADMIN: return render(constants.ADMIN_NAME, '/api/v1/cloudron/avatar');
case clientdb.TYPE_EXTERNAL: return render('External Application', '/api/v1/cloudron/avatar');
case clientdb.TYPE_SIMPLE_AUTH: return sendError(req, res, 'Unkown OAuth client');
default: break;
}
@@ -374,6 +375,7 @@ var authorization = [
if (type === clientdb.TYPE_ADMIN) return next();
if (type === clientdb.TYPE_EXTERNAL) return next();
if (type === clientdb.TYPE_SIMPLE_AUTH) return sendError(req, res, 'Invalid request. Unkonwn OAuth client.');
appdb.get(req.oauth2.client.appId, function (error, appObject) {
if (error) return sendErrorPageOrRedirect(req, res, 'Invalid request. Unknown app for this client_id.');