File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 11import { Request } from "../Request.js" ;
22import { Authorisation } from "./Authorisation.js" ;
33
4+ /**
5+ * Handles authentication for requests.
6+ */
47export interface Authenticator < A extends any > {
5- authenticate ( request : Request < A > ) : Promise < Authorisation < A > | null > ;
6-
8+ /**
9+ * Check whether this can handle authentication for the given request. The authenticator should return `false` if
10+ * the request lacks the information required to begin authentication.
11+ * @param request
12+ */
713 canAuthenticate ( request : Request < A > ) : boolean ;
14+
15+ /**
16+ * Authenticate the given request. If authenticate fails, e.g. due to missing or invalid information, such as
17+ * credentials, the authenticator should return `null`, which can be communicated to the client by implementing
18+ * applications using a 401 status response.
19+ * @param request
20+ */
21+ authenticate ( request : Request < A > ) : Promise < Authorisation < A > | null > ;
822}
You can’t perform that action at this time.
0 commit comments