mirror of
https://github.com/strapi/strapi.git
synced 2025-11-15 01:28:07 +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');
|
return ctx.unauthorized('Missing credentials');
|
||||||
},
|
},
|
||||||
async verify(auth, config = {}) {
|
async verify(auth, config = {}) {
|
||||||
|
|||||||
@ -20,11 +20,10 @@ const createStrapiInstance = async ({ ensureSuperAdmin = true, logLevel = 'fatal
|
|||||||
const options = { dir: TEST_APP_URL };
|
const options = { dir: TEST_APP_URL };
|
||||||
const instance = strapi(options);
|
const instance = strapi(options);
|
||||||
|
|
||||||
await instance.load();
|
instance.container.get('auth').register('content-api', {
|
||||||
|
name: 'test-auth',
|
||||||
instance.container.get('auth').register({
|
|
||||||
name: 'test-strategy',
|
|
||||||
authenticate() {
|
authenticate() {
|
||||||
|
console.log('lala');
|
||||||
return { authenticated: true };
|
return { authenticated: true };
|
||||||
},
|
},
|
||||||
verify() {
|
verify() {
|
||||||
@ -32,6 +31,8 @@ const createStrapiInstance = async ({ ensureSuperAdmin = true, logLevel = 'fatal
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await instance.load();
|
||||||
|
|
||||||
instance.log.level = logLevel;
|
instance.log.level = logLevel;
|
||||||
|
|
||||||
instance.server.mount();
|
instance.server.mount();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user