mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 02:44:55 +00:00
Register test auth before load
This commit is contained in:
parent
a14b16af51
commit
4befaea442
@ -69,8 +69,6 @@ const createAuthentication = () => {
|
||||
}
|
||||
}
|
||||
|
||||
console.log('ici');
|
||||
|
||||
return ctx.unauthorized('Missing credentials');
|
||||
},
|
||||
async verify(auth, config = {}) {
|
||||
|
||||
@ -20,11 +20,10 @@ const createStrapiInstance = async ({ ensureSuperAdmin = true, logLevel = 'fatal
|
||||
const options = { dir: TEST_APP_URL };
|
||||
const instance = strapi(options);
|
||||
|
||||
await instance.load();
|
||||
|
||||
instance.container.get('auth').register({
|
||||
name: 'test-strategy',
|
||||
instance.container.get('auth').register('content-api', {
|
||||
name: 'test-auth',
|
||||
authenticate() {
|
||||
console.log('lala');
|
||||
return { authenticated: true };
|
||||
},
|
||||
verify() {
|
||||
@ -32,6 +31,8 @@ const createStrapiInstance = async ({ ensureSuperAdmin = true, logLevel = 'fatal
|
||||
},
|
||||
});
|
||||
|
||||
await instance.load();
|
||||
|
||||
instance.log.level = logLevel;
|
||||
|
||||
instance.server.mount();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user