firebase / firebase/functions-samples

[BUG] in sample: LinkedIn Auth __session cookie does not persist when function is called by popup.html

Open
#876 1 comment 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
JavaScript
Stars
12.2k
Forks
3.8k
Avg merge
3d 23h
Merged PRs (30d)
1

Description

### Which sample has a bug?

LinkedIn Auth

### How to reproduce the issue

Use popup.html and cloud functions as expected, however, due to node-linkedin deprecation, use axios to query for profile data. I would be willing to submit this for a PR once this bug is figured out.

**Steps to set up and reproduce**

Follow LinkedIn sign in flow, redirect function -> token function, etc.

### Debug output

req.cookies.__session returns null. However, if the token function is called manually (i.e., console.log popup.html's script.src and following the link), the __session cookie is there.

**Errors in the
[console logs](https://console.firebase.google.com/project/_/functions/logs?search=&severity=DEBUG)**

**Screenshots**
![cookie in redirect](https://user-images.githubusercontent.com/19596891/120559723-87dd3580-c3cf-11eb-9d88-4233073ee467.PNG)
Cookie in redirect
![cookie when called by popup](https://user-images.githubusercontent.com/19596891/120559755-9297ca80-c3cf-11eb-9374-a40db16fcab7.PNG)
Cookie in token function when called by popup
![cookie when called manually](https://user-images.githubusercontent.com/19596891/120559767-9b889c00-c3cf-11eb-97d4-6ee610381a91.PNG)
Cookie in token function when called manually

### Expected behavior

Cookie is null

### Actual behavior

Cookie persists

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.