Skip to content

Commit c128967

Browse files
committed
Callback URL
This small change gives the adminstrator the correct callback URL to use depending on where the application is running.
1 parent 4d2705b commit c128967

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/client/components/Settings.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import LogoUpload from './LogoUpload'
88
import MediaQueryComponent from '../components/MediaQueryComponent'
99

1010
function Error({message, callbackUrl}) {
11-
console.log(message, callbackUrl)
1211
if (message) {
1312
let description = message
1413
if (message.match(/Could not authenticate/)) {
@@ -76,18 +75,18 @@ export default class Settings extends MediaQueryComponent {
7675
let welcome = ''
7776
if (! this.props.userLoggedIn) {
7877
const q = new URLSearchParams(window.location.search)
79-
const callbackUrl = 'https://demo.docnow.dev/auth/twitter/callback'
78+
79+
const callbackUrl = `${window.location.protocol}//${window.location.hostname}/auth/twitter/callback`
8080
const error = <Error message={q.get('error')} callbackUrl={callbackUrl} />
8181

8282
welcome = (
8383
<div className={style.Welcome}>
8484
<b>Welcome!</b>
8585
<p>
8686
To setup DocNow, you will need to visit the
87-
<a href="https://developer.twitter.com">Twitter Developer Portal</a> and
87+
<a href="https://developer.twitter.com/en/portal/">Twitter Developer Portal</a> and
8888
create a <em>Twitter application</em>. This is required because you will
89-
need to enter your <em>Application key</em> and
90-
<em>Application key secret</em> below.
89+
need to enter your <em>Application key</em> and <em>Application key secret</em> below.
9190
</p>
9291
<ol>
9392
<li>Set your <em>Description</em> to something that describes your DocNow instance for users who are logging in.</li>

0 commit comments

Comments
 (0)