mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-08 06:38:46 +00:00
homepage-plus
This commit is contained in:
parent
2ee5fd123b
commit
e2387f6b65
15 changed files with 271 additions and 56 deletions
21
src/utils/identity/null.js
Normal file
21
src/utils/identity/null.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
const NullIdentity = { user: null, groups: [] };
|
||||
|
||||
function createNullIdentity() {
|
||||
return {
|
||||
getIdentity: () => NullIdentity,
|
||||
getContext: () => ({
|
||||
provider: "null",
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
async function fetchNullIdentity([key]) {
|
||||
return fetch(key).then((res) => res.json());
|
||||
}
|
||||
|
||||
const NullIdentityProvider = {
|
||||
create: createNullIdentity,
|
||||
fetch: fetchNullIdentity,
|
||||
};
|
||||
|
||||
export default NullIdentityProvider;
|
Loading…
Add table
Add a link
Reference in a new issue