Basic HTTP Provider can be used for basic cases. All basic authentication information will be easily sent to each XHR request. By default, basic authentication returns only the username used for credentials. If you prefer to use a specific API endpoint to provide more user information to Olobase Admin (this is recommended if you need functional profile editing), you need to set the user route as follows:
src/plugins/admin.js
import {
basicAuthProvider,
} from "olobase-admin/src/providers";
import OlobaseAdmin from "olobase-admin";
let admin = new OlobaseAdmin(import.meta.env);
//...
/**
* Install admin plugin
*/
export default {
install: (app, http, resources) => {
//...
admin.setOptions({
//...
authProvider: basicAuthProvider(http, {
routes: {
user: "/api/user",
}
},
//...
});
//...
}
}