hi
i am trying to make api in odk central to logout of odk central, so that i call the same api from another jsp page ,
on the top of user.js file is added
import { logOut } from '../../../client/src/util/session';
import { noop } from '../../../client/src/util/util';
module.exports = (service, endpoint) => {
inject: ['container'];
and inside the user.js file is below
service.get('/users/current/logoutodk', endpoint(({}) =>
.then(() => {
logOut(this.container, false)
.then(() => {
// this.alert.success(this.$t('alert.logOut');
response.cookie('__Host-session', 'null', { path: '/', expires: new Date(0),
httpOnly: true, secure: true, sameSite: 'strict' });
response.cookie('__csrf', 'null', { path: '/', expires: new Date(0),
httpOnly: true, secure: true, sameSite: 'strict'});
})
.catch(noop);
})));
i am trying to see if this call can be done from a jsp page as below
<% $.ajax({ type: "GET", url: "https://oiosodkcentuat.cag.gov.in/v1/users/current/logout", success: function(data){ alert(data); } }); Cookie cookie =null; Cookie[] cookies =null;// Get an array of Cookies associated with the this domain cookies = request.getCookies(); if( cookies !=null) { for(int i =0; i < cookies.length; i++){ cookie = cookies[i]; cookie.setMaxAge(0); cookie.setValue(null); cookie.setPath("/"); response.addCookie(cookie); } } %>but is not successfull ,
i am continously gettting the error
pls help odk central development tea where i am going wrong.