You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 2, 2024. It is now read-only.
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';
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);
})
}
}