@@ -3,7 +3,6 @@ import { CreateRequestFunction, MigrationState } from './types/internal'
33import StorageManager from './StorageManager'
44import Constants from './Constants'
55import ArgsBuilder from './ArgsBuilder'
6- import shajs from 'sha.js'
76
87type Region = 'eu1' | 'in1' | 'sg1' | 'us1' | 'sk1' ;
98
@@ -244,7 +243,6 @@ export enum IdentityState {
244243
245244export class IdentityManager {
246245 private state : IdentityState = IdentityState . ANONYMOUS
247- private anonymousLoginUserId : string
248246
249247 constructor (
250248 private userId : string ,
@@ -255,7 +253,6 @@ export class IdentityManager {
255253
256254 public setUserId ( userId : string ) : void {
257255 if ( this . state === IdentityState . ANONYMOUS ) {
258- this . anonymousLoginUserId = userId
259256 this . state = IdentityState . IDENTIFIED
260257 }
261258 this . userId = userId
@@ -270,33 +267,14 @@ export class IdentityManager {
270267 }
271268
272269 public identifyNonAnonymous ( ) : void {
273- if ( this . state === IdentityState . ANONYMOUS ) {
274- this . anonymousLoginUserId = this . userId
275- }
276270 this . state = IdentityState . IDENTIFIED
277271 }
278272
279- public get cleverTapID ( ) : string {
280- if ( this . userId !== this . anonymousLoginUserId && ! this . isAnonymous ) {
281- const sha = this . sha256 ( this . userId )
282-
283- return `${ this . deviceId } _${ sha } `
284- }
285-
286- return this . deviceId
287- }
288-
289273 public get profile ( ) : { [ key : string ] : string } {
290274 return { Identity : this . userId }
291275 }
292276
293277 public get isAnonymous ( ) : boolean {
294278 return this . userId === this . deviceId
295279 }
296-
297- private sha256 ( s : string ) : string {
298- const sha = new shajs . sha256 ( ) . update ( s ) . digest ( 'hex' )
299-
300- return sha . substring ( 0 , 10 )
301- }
302280}
0 commit comments