1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-11 03:34:35 +00:00

chore: server issue fix

This commit is contained in:
Saad Jutt
2021-11-10 08:33:44 +05:00
parent 652af82dac
commit 98ef40ffd6
3 changed files with 18 additions and 21 deletions

View File

@@ -1,30 +1,25 @@
import axios from 'axios'
import React, { useState } from 'react'
import PropTypes from 'prop-types'
import { CssBaseline, Box, TextField, Button } from '@mui/material'
const getAuthCode = async (credentials: any) => {
return axios
.post('/SASjsApi/auth/authorize', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(credentials)
})
.then((data: any) => data.json())
return fetch('/SASjsApi/auth/authorize', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(credentials)
}).then((data) => data.json())
}
const getTokens = async (payload: any) => {
return axios
.post('/SASjsApi/auth/token', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
})
.then((data: any) => data.json())
return fetch('/SASjsApi/auth/token', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
}).then((data) => data.json())
}
const Login = ({ setTokens }: any) => {