fix(core): Fix authorization handling and format code.
This commit is contained in:
parent
b610cba9ac
commit
1212ee9116
@ -1,5 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## 2024-10-05 - 1.1.2 - fix(core)
|
||||
Fix authorization handling and format code.
|
||||
|
||||
- Resolved the incorrect condition check for 'authorizationStringArg' within the 'init' function.
|
||||
- Corrected the condition to activate 'debugMode' within the 'init' function.
|
||||
- Improved code formatting for better readability.
|
||||
|
||||
## 2024-10-05 - 1.1.1 - fix(platformclient)
|
||||
Refactor debug mode checks in SzPlatformClient connectors
|
||||
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@serve.zone/platformclient',
|
||||
version: '1.1.1',
|
||||
version: '1.1.2',
|
||||
description: 'a module that makes it really easy to use the serve.zone platform inside your app'
|
||||
}
|
||||
|
@ -21,18 +21,25 @@ export class SzPlatformClient {
|
||||
}
|
||||
|
||||
public async init(authorizationStringArg?: string) {
|
||||
if (authorizationStringArg) this.authorizationString = authorizationStringArg;
|
||||
if (!this.authorizationString) this.authorizationString = process.env.SERVEZONE_PLATFROM_AUTHORIZATION;
|
||||
if (authorizationStringArg) {
|
||||
this.authorizationString = authorizationStringArg;
|
||||
}
|
||||
if (!this.authorizationString)
|
||||
this.authorizationString = process.env.SERVEZONE_PLATFROM_AUTHORIZATION;
|
||||
if (!this.authorizationString) throw new Error('authorizationString is required');
|
||||
if (authorizationStringArg === 'test') {
|
||||
if (this.authorizationString === 'test') {
|
||||
this.debugMode = true;
|
||||
console.log('debug mode activated.');
|
||||
return;
|
||||
}
|
||||
this.typedsocket = await plugins.typedsocket.TypedSocket.createClient(this.typedrouter, await this.getConnectionAddress());
|
||||
this.typedsocket = await plugins.typedsocket.TypedSocket.createClient(
|
||||
this.typedrouter,
|
||||
await this.getConnectionAddress()
|
||||
);
|
||||
}
|
||||
|
||||
private async getConnectionAddress() {
|
||||
const connectionAddress = await this.qenvInstance.getEnvVarOnDemand('SERVEZONE_API_DOMAIN');
|
||||
return connectionAddress;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,12 @@ export class SzSmsConnector {
|
||||
public async sendSmsVerifcation(
|
||||
recipientArg: plugins.servezoneInterfaces.platformservice.sms.IRequest_SendVerificationCode['request']
|
||||
) {
|
||||
if (this.platformClientRef.debugMode) {
|
||||
console.log('sendSmsVerifcation', recipientArg, '123456');
|
||||
return '123456';
|
||||
}
|
||||
|
||||
|
||||
const typedrequest =
|
||||
this.platformClientRef.typedsocket.createTypedRequest<plugins.servezoneInterfaces.platformservice.sms.IRequest_SendVerificationCode>(
|
||||
'sendVerificationCode'
|
||||
|
Loading…
x
Reference in New Issue
Block a user