Skip to content

Commit 992f0c6

Browse files
added redirect query
1 parent f068471 commit 992f0c6

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "5.0.0",
44
"private": true,
55
"scripts": {
6-
"build": "REACT_APP_BACKEND=true PUBLIC_URL='/sing-app-react' node scripts/build.js",
6+
"build": "cross-env REACT_APP_BACKEND=true cross-env PUBLIC_URL='/sing-app-react' node scripts/build.js",
77
"start": "node scripts/start.js",
88
"start:backend": "cross-env REACT_APP_BACKEND=true node scripts/start.js",
99
"test": "node scripts/test.js"

src/actions/auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export function loginUser(creds) {
122122
type: LOGIN_REQUEST,
123123
});
124124
if (creds.social) {
125-
window.location.href = config.baseURLApi + "/auth/signin/" + creds.social;
125+
window.location.href = config.baseURLApi + "/auth/signin/" + creds.social + '?app=' + config.redirectUrl;
126126
} else if (creds.email.length > 0 && creds.password.length > 0) {
127127
axios.post("/auth/signin/local", creds).then(res => {
128128
const token = res.data;

src/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
const hostApi = process.env.NODE_ENV === "development" ? "http://localhost" : "https://sing-generator-node.herokuapp.com";
22
const portApi = process.env.NODE_ENV === "development" ? 8080 : "";
33
const baseURLApi = `${hostApi}${portApi ? `:${portApi}` : ``}/api`;
4+
const redirectUrl = process.env.NODE_ENV === "development" ? "http://localhost:5000/sing-app-react" : "https://demo.flatlogic.com/sing-app-react";
45

56
export default {
7+
redirectUrl,
68
hostApi,
79
portApi,
810
baseURLApi,

0 commit comments

Comments
 (0)