Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Access-Control-Allow-Origin #4

Description

@multisolusiit

I have this error:

XMLHttpRequest cannot load http://localhost:8069/web/session/authenticate. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. The response had HTTP status code 400.

---- here's my code ---
import { Component } from '@angular/core';
import { OdooRPCService } from 'angular2-odoo-jsonrpc';

@component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
providers: [OdooRPCService]
})

export class AppComponent {
title = 'app works!';

constructor(odooRPC: OdooRPCService){
odooRPC.init({
odoo_server: "http://localhost:8069",
http_auth: "duniakado@go2.web.id:password"
});
odooRPC.login('duniakado', 'duniakado@go2.web.id', 'password').then(res => {
console.log('login success');
}).catch( err => {
console.error('login failed', err);
})
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions