mongodb-stitch
Version:
[](https://gitter.im/mongodb/stitch?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
50 lines • 2.32 kB
JavaScript
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define(["require", "exports", "./StitchRoutes"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var StitchRoutes_1 = require("./StitchRoutes");
function getAuthProviderRoute(clientAppId, providerName) {
return StitchRoutes_1.getAppRoute(clientAppId) + ("/auth/providers/" + providerName);
}
function getAuthProviderLoginRoute(clientAppId, providerName) {
return getAuthProviderRoute(clientAppId, providerName) + "/login";
}
function getAuthProviderLinkRoute(clientAppId, providerName) {
return getAuthProviderLoginRoute(clientAppId, providerName) + "?link=true";
}
var StitchAppAuthRoutes = (function () {
function StitchAppAuthRoutes(clientAppId) {
var _this = this;
this.baseAuthRoute = StitchRoutes_1.BASE_ROUTE + "/auth";
this.sessionRoute = (function () {
return _this.baseAuthRoute + "/session";
})();
this.profileRoute = (function () {
return _this.baseAuthRoute + "/profile";
})();
this.clientAppId = clientAppId;
}
StitchAppAuthRoutes.prototype.getAuthProviderRoute = function (providerName) {
return getAuthProviderRoute(this.clientAppId, providerName);
};
StitchAppAuthRoutes.prototype.getAuthProviderLoginRoute = function (providerName) {
return getAuthProviderLoginRoute(this.clientAppId, providerName);
};
StitchAppAuthRoutes.prototype.getAuthProviderLinkRoute = function (providerName) {
return getAuthProviderLinkRoute(this.clientAppId, providerName);
};
StitchAppAuthRoutes.prototype.getAuthProviderExtensionRoute = function (providerName, path) {
return this.getAuthProviderRoute(providerName) + "/" + path;
};
return StitchAppAuthRoutes;
}());
exports.default = StitchAppAuthRoutes;
});
//# sourceMappingURL=StitchAppAuthRoutes.js.map