Skip to content
Permalink
Browse files

Do not use authorization for now

  • Loading branch information
tillkahlbrock committed Oct 9, 2019
1 parent 628bb6d commit 5bbb8c9fab7705b3954f86d34981078b8e52261c
Showing with 2 additions and 6 deletions.
  1. +2 −6 src/Form.js
@@ -60,12 +60,8 @@ async function shorten({url}, updateFormType, updateShortId) {
try {
let apiName = 'URLShortener';
let path = '/short';
let token = `${(await Auth.currentSession()).getIdToken().getJwtToken()}`;
let init = {
body: { url },
headers: {
Authorization: `Bearer ${token}`
}
body: { url }
};
API.post(apiName, path, init).then(response => {
updateFormType('shortened');
@@ -79,7 +75,7 @@ async function shorten({url}, updateFormType, updateShortId) {
}

export default function Form() {
const [formType, updateFormType] = useState('signIn');
const [formType, updateFormType] = useState('authenticated');
const [formState, updateFormState] = useReducer(reducer, initialFormState);
function renderForm() {
switch(formType) {

0 comments on commit 5bbb8c9

Please sign in to comment.
You can’t perform that action at this time.