Skip to content

Commit 245c601

Browse files
authored
dev-env: separate backend and auth for user-auth (#48)
this requires a separate shared kratos to be spun up for dev endpoints will change to the following format: previously: <developer-namespace>.<domain> auth endpoints: dev.<domain> backend endpoints: <developer-namespace>.dev.<domain> and cookies for auth would be set on dev.<domain> so can share session
1 parent 593102a commit 245c601

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

templates/src/api/kratos.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const capitalize = (str) => `${str[0].toUpperCase()}${str.slice(1)}`
66
* Kratos redirects and sets cookie upon client lands on URL and redirects back to
77
* frontend with request_id
88
* */
9-
const authPublicURL = `${config.backendURL}/.ory/kratos/public`;
10-
const authAdminURL = `${config.backendURL}/.ory/kratos`;
9+
const authPublicURL = `${config.authBackendURL}/.ory/kratos/public`;
10+
const authAdminURL = `${config.authBackendURL}/.ory/kratos`;
1111

1212
/**
1313
* publicApi / adminApi are initialized Kratos SDK client with public / admin endpoints,
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"appName": "<% .Name %>",
33
"environment": "development",
4-
"backendURL": "http://localhost:8080"<%if eq (index .Params `billingEnabled`) "yes" %>,
4+
"backendURL": "http://localhost:8080"
5+
<%- if eq (index .Params `billingEnabled`) "yes" %>,
6+
"authBackendURL": "https://dev.<% index .Params `stagingHostRoot` %>",
7+
<% end %>
8+
<%- if eq (index .Params `billingEnabled`) "yes" %>,
59
"stripePublishableKey": "<% index .Params `stagingStripePublicApiKey` %>"<% end %>
610
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"appName": "<% .Name %>",
33
"environment": "production",
4-
"backendURL": "https://<% index .Params `productionBackendSubdomain` %><% index .Params `productionHostRoot` %>"<%if eq (index .Params `billingEnabled`) "yes" %>,
4+
"backendURL": "https://<% index .Params `productionBackendSubdomain` %><% index .Params `productionHostRoot` %>",
5+
"authBackendURL": "https://<% index .Params `productionBackendSubdomain` %><% index .Params `productionHostRoot` %>"<%if eq (index .Params `billingEnabled`) "yes" %>,
56
"stripePublishableKey": "<% index .Params `productionStripePublicApiKey` %>"<% end %>
67
}

templates/src/config/staging.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"appName": "<% .Name %>",
33
"environment": "staging",
4-
"backendURL": "https://<% index .Params `stagingBackendSubdomain` %><% index .Params `stagingHostRoot` %>"<%if eq (index .Params `billingEnabled`) "yes" %>,
4+
"backendURL": "https://<% index .Params `stagingBackendSubdomain` %><% index .Params `stagingHostRoot` %>",
5+
"authBackendURL": "https://<% index .Params `stagingBackendSubdomain` %><% index .Params `stagingHostRoot` %>"<%if eq (index .Params `billingEnabled`) "yes" %>,
56
"stripePublishableKey": "<% index .Params `stagingStripePublicApiKey` %>"<% end %>
67
}

0 commit comments

Comments
 (0)