use of com.rebuild.api.ApiInvokeException in project rebuild by getrebuild.
the class PageTokenVerify method execute.
@Override
public JSON execute(ApiContext context) throws ApiInvokeException {
String token = context.getParameterNotBlank("token");
ID tokenUser = verify(token);
if (tokenUser == null) {
throw new ApiInvokeException("Invalid token : " + token);
}
User user = Application.getUserStore().getUser(tokenUser);
JSON ret = JSONUtils.toJSONObject(new String[] { "user_id", "login_name", "full_name" }, new Object[] { user.getId(), user.getName(), user.getFullName() });
return formatSuccess(ret);
}
Aggregations