Skip to content

Commit

Permalink
Set anonymous id if cookie already exists (#18)
Browse files Browse the repository at this point in the history
* Set anonymous id if cookie exists

* Bump version
  • Loading branch information
chrisfisher committed Aug 10, 2022
1 parent 7d7b809 commit d8d54b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@authsignal/browser",
"type": "module",
"version": "0.0.13",
"version": "0.0.14",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 3 additions & 1 deletion src/authsignal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export class Authsignal {

const idCookie = getCookie(this.anonymousIdCookieName);

if (!idCookie) {
if (idCookie) {
this.anonymousId = idCookie;
} else {
this.anonymousId = uuidv4();

setCookie({
Expand Down

0 comments on commit d8d54b8

Please sign in to comment.