2
0
Fork
You've already forked cms
0

refactor AuthProvider interface and Basic implementation #74

Merged
esroyo merged 2 commits from main into main 2026年03月30日 11:37:56 +02:00
esroyo commented 2026年03月30日 08:59:42 +02:00 (Migrated from github.com)
Copy link
  • adds AuthProvider['init'] to inject CmsOptions
  • merges AuthProvider['getUsername'] into AuthProvider['login']
- adds `AuthProvider['init']` to inject CmsOptions - merges `AuthProvider['getUsername']` into `AuthProvider['login']`
@ -1,49 +1,68 @@
import type { AuthProvider, UserConfiguration } from "../types.ts";
import type { AuthProvider, AuthProviderOptions } from "../types.ts";

The return type can be Response or Promise<Response>. So this function don't need to be async. And _request argument could be omitted.

The return type can be `Response` or `Promise<Response>`. So this function don't need to be async. And `_request` argument could be omitted.

We can drop async and the unused argument from this

We can drop `async` and the unused argument from this
@ -41,14 +41,16 @@ export interface SiteInfo {
body?: string;
}

Can you move this to an interface?

interface AuthProviderOptions {
 basePath: string;
 users: Map<string, UserConfiguration>,
}
Can you move this to an interface? ```ts interface AuthProviderOptions { basePath: string; users: Map<string, UserConfiguration>, } ```

Perfect! Thank you!

Perfect! Thank you!
esroyo commented 2026年03月30日 11:56:13 +02:00 (Migrated from github.com)
Copy link

My pleasure! thanks @oscarotero

My pleasure! thanks @oscarotero
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lume/cms!74
Reference in a new issue
lume/cms
No description provided.
Delete branch "main"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?