mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-04 18:09:09 +00:00
implementation of rest comunication on gateway
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import axios from "axios";
|
||||
|
||||
|
||||
export class AuthenticateController{
|
||||
|
||||
private username:string;
|
||||
private password:string;
|
||||
|
||||
constructor(){
|
||||
this.username = process.env.AUTH_USERNAME
|
||||
this.password = process.env.AUTH_PASSWORD
|
||||
}
|
||||
|
||||
|
||||
|
||||
async authenticate():Promise<string>{
|
||||
|
||||
const response = await axios.post(process.env.AUTH_ROUTE,
|
||||
{
|
||||
username:this.username,
|
||||
password:this.password
|
||||
}
|
||||
)
|
||||
|
||||
return response.data.accessToken
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user