Skip to content

Commit

Permalink
Merge pull request #21 from exdevutem/patch/reparado-login-siga
Browse files Browse the repository at this point in the history
patch: reparado login de siga
  • Loading branch information
exdevutembot authored Apr 18, 2024
2 parents 179ce7e + dadb072 commit 6592392
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/siga-api/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import {HashUtils} from "../../infrastructure/utils/hash.utils";
export class SigaApiAuthService {
public static async loginAndGetToken(correo: string, contrasenia: string): Promise<string> {
try {
const res = await axios.post(`${process.env.SIGA_API_URL}/autenticacion/login/`, `username=${correo}&password=${contrasenia}`, {
const form = new FormData;
form.set('username', correo);
form.set('password', contrasenia);
const res = await axios.post(`${process.env.SIGA_API_URL}/autenticacion/login/`, form, {
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Host: "siga.utem.cl",
Expand Down Expand Up @@ -38,7 +41,10 @@ export class SigaApiAuthService {

public static async loginAndGetProfile(correo: string, contrasenia: string): Promise<Usuario> {
try {
const res = await axios.post(`${process.env.SIGA_API_URL}/autenticacion/login/`, `username=${correo}&password=${contrasenia}`, {
const form = new FormData;
form.set('username', correo);
form.set('password', contrasenia);
const res = await axios.post(`${process.env.SIGA_API_URL}/autenticacion/login/`, form, {
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Host: "siga.utem.cl",
Expand Down

0 comments on commit 6592392

Please sign in to comment.