"use strict";

/*
 * *******************************************************************************
 *  * Copyright (c) 2018 Edgeworx, Inc.
 *  *
 *  * This program and the accompanying materials are made available under the
 *  * terms of the Eclipse Public License v. 2.0 which is available at
 *  * http://www.eclipse.org/legal/epl-2.0
 *  *
 *  * SPDX-License-Identifier: EPL-2.0
 *  *******************************************************************************
 *
 */

$(document).ready(function () {
    activateUserAccount().then(function (result) {
        AppWorks_Start();
    });
});

var activateUserAccount = function activateUserAccount() {
    return $.ajax({
        url: fogControllerUrl + ioAuthoring.urls.activateUserAccount + code,
        dataType: "json",
        success: function success(res) {
            if (res.status == 'ok') {
                $("#activationResult").html(ejs.render(ioAuthoring.templates.userActivationSuccessful, {}, {}));
            } else {
                $("#activationResult").html(ejs.render(ioAuthoring.templates.userActivationUnsuccessful, {}, {}));
            }
        }
    });
};