Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 38 additions & 3 deletions boilerplate/backend/go-http/config/all_auth.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package main

import (
"github.com/supertokens/supertokens-golang/recipe/dashboard"
"os"

"github.com/supertokens/supertokens-golang/recipe/dashboard"
"github.com/supertokens/supertokens-golang/recipe/session"
"github.com/supertokens/supertokens-golang/recipe/emailpassword"
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
Expand All @@ -11,14 +13,47 @@ import (
"github.com/supertokens/supertokens-golang/supertokens"
)

func getApiDomain() string {
apiPortStr := os.Getenv("REACT_APP_API_PORT")
if apiPortStr == "" {
apiPortStr = os.Getenv("VITE_API_PORT")
if apiPortStr == "" {
apiPortStr = "3001"
}
}
apiUrl := os.Getenv("REACT_APP_API_URL")
if apiUrl == "" {
apiUrl = "http://localhost:" + apiPortStr
}

return apiUrl
}

func getWebsiteDomain() string {
websitePortStr := os.Getenv("PORT")
if websitePortStr == "" {
websitePortStr = os.Getenv("VITE_APP_PORT")
if websitePortStr == "" {
websitePortStr = "3000"
}
}
websiteUrl := os.Getenv("REACT_APP_WEBSITE_URL")
if websiteUrl == "" {
websiteUrl = "http://localhost:" + websitePortStr
}

return websiteUrl
}


var SuperTokensConfig = supertokens.TypeInput{
Supertokens: &supertokens.ConnectionInfo{
ConnectionURI: "https://try.supertokens.com",
},
AppInfo: supertokens.AppInfo{
AppName: "SuperTokens Demo App",
APIDomain: "http://localhost:3001",
WebsiteDomain: "http://localhost:3000",
APIDomain: getApiDomain(),
WebsiteDomain: getWebsiteDomain(),
},
RecipeList: []supertokens.Recipe{
emailpassword.Init(nil),
Expand Down
38 changes: 36 additions & 2 deletions boilerplate/backend/go-http/config/emailpassword.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,54 @@
package main

import (
"os"

"github.com/supertokens/supertokens-golang/recipe/dashboard"
"github.com/supertokens/supertokens-golang/recipe/emailpassword"
"github.com/supertokens/supertokens-golang/recipe/session"
"github.com/supertokens/supertokens-golang/supertokens"
)

func getApiDomain() string {
apiPortStr := os.Getenv("REACT_APP_API_PORT")
if apiPortStr == "" {
apiPortStr = os.Getenv("VITE_API_PORT")
if apiPortStr == "" {
apiPortStr = "3001"
}
}
apiUrl := os.Getenv("REACT_APP_API_URL")
if apiUrl == "" {
apiUrl = "http://localhost:" + apiPortStr
}

return apiUrl
}

func getWebsiteDomain() string {
websitePortStr := os.Getenv("PORT")
if websitePortStr == "" {
websitePortStr = os.Getenv("VITE_APP_PORT")
if websitePortStr == "" {
websitePortStr = "3000"
}
}
websiteUrl := os.Getenv("REACT_APP_WEBSITE_URL")
if websiteUrl == "" {
websiteUrl = "http://localhost:" + websitePortStr
}

return websiteUrl
}

var SuperTokensConfig = supertokens.TypeInput{
Supertokens: &supertokens.ConnectionInfo{
ConnectionURI: "https://try.supertokens.com",
},
AppInfo: supertokens.AppInfo{
AppName: "SuperTokens Demo App",
APIDomain: "http://localhost:3001",
WebsiteDomain: "http://localhost:3000",
APIDomain: getApiDomain(),
WebsiteDomain: getWebsiteDomain(),
},
RecipeList: []supertokens.Recipe{
emailpassword.Init(nil),
Expand Down
42 changes: 38 additions & 4 deletions boilerplate/backend/go-http/config/multitenancy.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,57 @@
package main

import (
"os"

"github.com/supertokens/supertokens-golang/recipe/dashboard"
"github.com/supertokens/supertokens-golang/recipe/session"
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/emailpassword"
"github.com/supertokens/supertokens-golang/recipe/passwordless"
"github.com/supertokens/supertokens-golang/recipe/passwordless/plessmodels"
"github.com/supertokens/supertokens-golang/recipe/session"
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/supertokens"
)

func getApiDomain() string {
apiPortStr := os.Getenv("REACT_APP_API_PORT")
if apiPortStr == "" {
apiPortStr = os.Getenv("VITE_API_PORT")
if apiPortStr == "" {
apiPortStr = "3001"
}
}
apiUrl := os.Getenv("REACT_APP_API_URL")
if apiUrl == "" {
apiUrl = "http://localhost:" + apiPortStr
}

return apiUrl
}

func getWebsiteDomain() string {
websitePortStr := os.Getenv("PORT")
if websitePortStr == "" {
websitePortStr = os.Getenv("VITE_APP_PORT")
if websitePortStr == "" {
websitePortStr = "3000"
}
}
websiteUrl := os.Getenv("REACT_APP_WEBSITE_URL")
if websiteUrl == "" {
websiteUrl = "http://localhost:" + websitePortStr
}

return websiteUrl
}

var SuperTokensConfig = supertokens.TypeInput{
Supertokens: &supertokens.ConnectionInfo{
ConnectionURI: "https://try.supertokens.com",
},
AppInfo: supertokens.AppInfo{
AppName: "SuperTokens Demo App",
APIDomain: "http://localhost:3001",
WebsiteDomain: "http://localhost:3000",
APIDomain: getApiDomain(),
WebsiteDomain: getWebsiteDomain(),
},
RecipeList: []supertokens.Recipe{
thirdparty.Init(nil),
Expand Down
38 changes: 36 additions & 2 deletions boilerplate/backend/go-http/config/passwordless.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,55 @@
package main

import (
"os"

"github.com/supertokens/supertokens-golang/recipe/dashboard"
"github.com/supertokens/supertokens-golang/recipe/passwordless"
"github.com/supertokens/supertokens-golang/recipe/passwordless/plessmodels"
"github.com/supertokens/supertokens-golang/recipe/session"
"github.com/supertokens/supertokens-golang/supertokens"
)

func getApiDomain() string {
apiPortStr := os.Getenv("REACT_APP_API_PORT")
if apiPortStr == "" {
apiPortStr = os.Getenv("VITE_API_PORT")
if apiPortStr == "" {
apiPortStr = "3001"
}
}
apiUrl := os.Getenv("REACT_APP_API_URL")
if apiUrl == "" {
apiUrl = "http://localhost:" + apiPortStr
}

return apiUrl
}

func getWebsiteDomain() string {
websitePortStr := os.Getenv("PORT")
if websitePortStr == "" {
websitePortStr = os.Getenv("VITE_APP_PORT")
if websitePortStr == "" {
websitePortStr = "3000"
}
}
websiteUrl := os.Getenv("REACT_APP_WEBSITE_URL")
if websiteUrl == "" {
websiteUrl = "http://localhost:" + websitePortStr
}

return websiteUrl
}

var SuperTokensConfig = supertokens.TypeInput{
Supertokens: &supertokens.ConnectionInfo{
ConnectionURI: "https://try.supertokens.com",
},
AppInfo: supertokens.AppInfo{
AppName: "SuperTokens Demo App",
APIDomain: "http://localhost:3001",
WebsiteDomain: "http://localhost:3000",
APIDomain: getApiDomain(),
WebsiteDomain: getWebsiteDomain(),
},
RecipeList: []supertokens.Recipe{
passwordless.Init(plessmodels.TypeInput{
Expand Down
38 changes: 36 additions & 2 deletions boilerplate/backend/go-http/config/thirdparty.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,55 @@
package main

import (
"os"

"github.com/supertokens/supertokens-golang/recipe/dashboard"
"github.com/supertokens/supertokens-golang/recipe/session"
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
"github.com/supertokens/supertokens-golang/supertokens"
)

func getApiDomain() string {
apiPortStr := os.Getenv("REACT_APP_API_PORT")
if apiPortStr == "" {
apiPortStr = os.Getenv("VITE_API_PORT")
if apiPortStr == "" {
apiPortStr = "3001"
}
}
apiUrl := os.Getenv("REACT_APP_API_URL")
if apiUrl == "" {
apiUrl = "http://localhost:" + apiPortStr
}

return apiUrl
}

func getWebsiteDomain() string {
websitePortStr := os.Getenv("PORT")
if websitePortStr == "" {
websitePortStr = os.Getenv("VITE_APP_PORT")
if websitePortStr == "" {
websitePortStr = "3000"
}
}
websiteUrl := os.Getenv("REACT_APP_WEBSITE_URL")
if websiteUrl == "" {
websiteUrl = "http://localhost:" + websitePortStr
}

return websiteUrl
}

var SuperTokensConfig = supertokens.TypeInput{
Supertokens: &supertokens.ConnectionInfo{
ConnectionURI: "https://try.supertokens.com",
},
AppInfo: supertokens.AppInfo{
AppName: "SuperTokens Demo App",
APIDomain: "http://localhost:3001",
WebsiteDomain: "http://localhost:3000",
APIDomain: getApiDomain(),
WebsiteDomain: getWebsiteDomain(),
},
RecipeList: []supertokens.Recipe{
thirdparty.Init(&tpmodels.TypeInput{
Expand Down
40 changes: 37 additions & 3 deletions boilerplate/backend/go-http/config/thirdpartyemailpassword.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,56 @@
package main

import (
"os"

"github.com/supertokens/supertokens-golang/recipe/dashboard"
"github.com/supertokens/supertokens-golang/recipe/session"
"github.com/supertokens/supertokens-golang/recipe/emailpassword"
"github.com/supertokens/supertokens-golang/recipe/session"
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
"github.com/supertokens/supertokens-golang/supertokens"
)

func getApiDomain() string {
apiPortStr := os.Getenv("REACT_APP_API_PORT")
if apiPortStr == "" {
apiPortStr = os.Getenv("VITE_API_PORT")
if apiPortStr == "" {
apiPortStr = "3001"
}
}
apiUrl := os.Getenv("REACT_APP_API_URL")
if apiUrl == "" {
apiUrl = "http://localhost:" + apiPortStr
}

return apiUrl
}

func getWebsiteDomain() string {
websitePortStr := os.Getenv("PORT")
if websitePortStr == "" {
websitePortStr = os.Getenv("VITE_APP_PORT")
if websitePortStr == "" {
websitePortStr = "3000"
}
}
websiteUrl := os.Getenv("REACT_APP_WEBSITE_URL")
if websiteUrl == "" {
websiteUrl = "http://localhost:" + websitePortStr
}

return websiteUrl
}

var SuperTokensConfig = supertokens.TypeInput{
Supertokens: &supertokens.ConnectionInfo{
ConnectionURI: "https://try.supertokens.com",
},
AppInfo: supertokens.AppInfo{
AppName: "SuperTokens Demo App",
APIDomain: "http://localhost:3001",
WebsiteDomain: "http://localhost:3000",
APIDomain: getApiDomain(),
WebsiteDomain: getWebsiteDomain(),
},
RecipeList: []supertokens.Recipe{
emailpassword.Init(nil),
Expand Down
Loading