File tree Expand file tree Collapse file tree 4 files changed +26
-6
lines changed Expand file tree Collapse file tree 4 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 3
3
"rules" : " database.rules.json"
4
4
},
5
5
"hosting" : {
6
- "public" : " public"
6
+ "public" : " public" ,
7
+ "rewrites" : [
8
+ {
9
+ "source" : " /redirect" ,
10
+ "function" : " redirect"
11
+ },
12
+ {
13
+ "source" : " /token" ,
14
+ "function" : " token"
15
+ }
16
+ ]
7
17
}
8
18
}
Original file line number Diff line number Diff line change 68
68
document . body . innerText = 'Error back from the Instagram auth page: ' + error ;
69
69
} else if ( ! code ) {
70
70
// Start the auth flow.
71
- window . location . href = 'https://us-central1-' + getFirebaseProjectId ( ) + '.cloudfunctions.net /redirect';
71
+ window . location . href = '/redirect' ;
72
72
} else {
73
73
// Use JSONP to load the 'token' Firebase Function to exchange the auth code against a Firebase custom token.
74
74
const script = document . createElement ( 'script' ) ;
75
75
script . type = 'text/javascript' ;
76
76
// This is the URL to the HTTP triggered 'token' Firebase Function.
77
77
// See https://firebase.google.com/docs/functions.
78
- var tokenFunctionURL = 'https://us-central1-' + getFirebaseProjectId ( ) + '.cloudfunctions.net /token';
78
+ var tokenFunctionURL = '/token' ;
79
79
script . src = tokenFunctionURL +
80
80
'?code=' + encodeURIComponent ( code ) +
81
81
'&state=' + encodeURIComponent ( state ) +
Original file line number Diff line number Diff line change 3
3
"rules" : " database.rules.json"
4
4
},
5
5
"hosting" : {
6
- "public" : " public"
6
+ "public" : " public" ,
7
+ "rewrites" : [
8
+ {
9
+ "source" : " /redirect" ,
10
+ "function" : " redirect"
11
+ },
12
+ {
13
+ "source" : " /token" ,
14
+ "function" : " token"
15
+ }
16
+ ]
7
17
}
8
18
}
Original file line number Diff line number Diff line change 68
68
document . body . innerText = 'Error back from the LinkedIn auth page: ' + error ;
69
69
} else if ( ! code ) {
70
70
// Start the auth flow.
71
- window . location . href = 'https://us-central1-' + getFirebaseProjectId ( ) + '.cloudfunctions.net /redirect';
71
+ window . location . href = '/redirect' ;
72
72
} else {
73
73
// Use JSONP to load the 'token' Firebase Function to exchange the auth code against a Firebase custom token.
74
74
const script = document . createElement ( 'script' ) ;
75
75
script . type = 'text/javascript' ;
76
76
// This is the URL to the HTTP triggered 'token' Firebase Function.
77
77
// See https://firebase.google.com/docs/functions.
78
- var tokenFunctionURL = 'https://us-central1-' + getFirebaseProjectId ( ) + '.cloudfunctions.net /token';
78
+ var tokenFunctionURL = '/token' ;
79
79
script . src = tokenFunctionURL +
80
80
'?code=' + encodeURIComponent ( code ) +
81
81
'&state=' + encodeURIComponent ( state ) +
You can’t perform that action at this time.
0 commit comments