Closed ryanwk closed 7 years ago
this might be the culprit url: config.apiOrigin + '/sign-up',
should be: url: config.development.apiOrigin + '/sign-up',
that didn't do it
that's my config file and it's required in api.js
const config = require('./config')
'use strict'
const config = {
apiOrigins: {
development: 'http://tic-tac-toe.wdibos.com',
production: 'https://ga-wdi-boston.herokuapp.com'
}
}
module.exports = config
making this change didn't work either in index.js
$('#sign-up-modal').on('submit', function (e) {
const data = getFormFields(this)
e.preventDefault()
api.development.signUpRequest(data)
// api.signInRequest()
})
})
andrew had a similar issue: https://github.com/ga-wdi-boston/game-project/issues/792
I tried his solution, no luck..
'use strict'
const config = {
apiOrigins: {
development: 'https://tic-tac-toe.wdibos.com',
production: 'https://aqueous-atoll-85096.herokuapp.com'
}
}
module.exports = config
when I enter a username and password then click the sign-in button of my modal. I get a console.log that tells me it did not work.
I think it may have something to do with the way get-form-fields works. Try switching your function in index.js from the submit of your modal to the submit of the form.
my event handler wasn't point toward the credentials that my request was expecting
$(() => {
$('#sign-up-form').on('submit', function (e) {
const data = getFormFields(this)
e.preventDefault()
api.signUpRequest(data)
// api.signInRequest()
})
})
so we added name="#sign-up-form" within my sign-up button form and this:
<input name="credentials[email]" type="email" class="form-control" id="inputEmail3" placeholder="Email">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">Password</label>
<div class="col-sm-10">
<input name="credentials[password]" type="password" class="form-control" id="inputPassword3" placeholder="Password">
</div>
</div>
also don't use this development: 'https://tic-tac-toe.wdibos.com',
config.js:
'use strict'
const config = {
apiOrigins: {
development: 'https://aqueous-atoll-85096.herokuapp.com',
production: 'https://aqueous-atoll-85096.herokuapp.com'
}
}
module.exports = config
thank you Jess!!
I'm getting my failure console log when I try to sign in, so it's not working, what am I missing?
I think everything is properly required and exported