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