Add appstore web token
* For existing installs, migrate using the soon to be obsoleted user_token route * For new installs, the token post login is stashed during registration time
This commit is contained in:
@@ -5,7 +5,7 @@ exports = module.exports = {
|
||||
getApp,
|
||||
getAppVersion,
|
||||
|
||||
createUserToken,
|
||||
getWebToken,
|
||||
registerCloudron,
|
||||
getSubscription
|
||||
};
|
||||
@@ -45,11 +45,11 @@ async function getAppVersion(req, res, next) {
|
||||
next(new HttpSuccess(200, manifest));
|
||||
}
|
||||
|
||||
async function createUserToken(req, res, next) {
|
||||
const [error, accessToken] = await safe(appstore.createUserToken());
|
||||
async function getWebToken(req, res, next) {
|
||||
const [error, accessToken] = await safe(appstore.getWebToken());
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(201, { accessToken }));
|
||||
next(new HttpSuccess(200, { accessToken }));
|
||||
}
|
||||
|
||||
async function registerCloudron(req, res, next) {
|
||||
|
||||
Reference in New Issue
Block a user