#1 2023-03-29 20:26:06

tbo
Member
Registered: 2015-04-20
Posts: 335

Extend AuthenticationRegister function

Until some time ago, the following could be written:

CreateWithOwnModel([TAuthGroup, TFileAuthUser], {HandleUserAuthentication=} False, pmcRootName);
// Register authentication methods selectively
AuthenticationRegister(TRestServerAuthenticationDefault);

Now the following must not be forgotten to be added:

fPublishedMethodAuthIndex := ServiceMethodRegister('auth', Auth, {bypassauth=}true, [mGET]);

Couldn't the AuthenticationRegister function be extended and do it at the same time?

AuthenticationRegister(aMethod: TRestServerAuthenticationClass; pmRegisterAuthMethod: Boolean = True): TRestServerAuthentication;

With best regards
Thomas

Offline

#2 2023-03-30 07:45:55

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,237
Website

Re: Extend AuthenticationRegister function

My guess is that this is a regression.
The /auth method should be published whenever AuthenticationRegister() is called.

Please see https://github.com/synopse/mORMot2/commit/c762832e

Offline

Board footer

Powered by FluxBB