api login
This commit is contained in:
parent
1cbd9e7c26
commit
5a152350be
3 changed files with 72 additions and 28 deletions
|
|
@ -48,6 +48,23 @@ class CallAPI {
|
|||
throw error;
|
||||
}
|
||||
}
|
||||
//Post
|
||||
public async PostDataKeycloak(@Path() path: any, sendData: any) {
|
||||
// const token = request.headers.authorization;
|
||||
const url = process.env.KC_URL + path;
|
||||
try {
|
||||
const response = await axios.post(url, sendData, {
|
||||
headers: {
|
||||
// Authorization: `${token}`,
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
api_key: process.env.API_KEY,
|
||||
},
|
||||
});
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default CallAPI;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue