ProtonMail / WebClients

Monorepo hosting the proton web clients
GNU General Public License v3.0
4.47k stars 566 forks source link

How do I start to develop on the interface? #174

Closed mauricioszabo closed 4 years ago

mauricioszabo commented 4 years ago

I'm following the instructions on the README, but I can't login on my current account while developing locally, but when I run npm start, the interface works fine but I can't login.

On the devtools, these are logged:

[HMR] Waiting for update signal from WDS...
client?b82a:48 [WDS] Hot Module Replacement enabled.
client?b82a:52 [WDS] Live Reloading enabled.
angular.js?3f7f:15570 Find a security bug?πŸ› security@protonmail.com
angular.js?3f7f:15570 We're hiring!β›° https://careers.protonmail.com/
:8080/login:1 Autofocus processing was blocked because a document already has a focused element.
:8080/login:1 A cookie associated with a cross-site resource at https://protonmail.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
loginContainer.js?12ff:223 PasswordError: Wrong private key password
    at eval (webpack-internal:///./src/app/authentication/directives/loginContainer.js:74:27)
dhoko commented 4 years ago

πŸ‘‹

My env:

Post git clone, I started with $ npm ci, then $ npm start Inside the console you should see something similar:

$ npm start

> protonmail-web@3.16.20 start /private/tmp/WebClient
> ./node_modules/proton-bundler/scripts/createVersionJSON.sh && cros
NV=dev tasks/setupConfig.js

[commit]                                
[tag]                                   
[output]            build/assets/version.json
βœ“ Generate configuration
βž™ Api: https://mail.protonmail.com/api
βž™ Sentry: undefined
βž™ Dev server: http://localhost:8080
βž™ Dev server: http://192.168.1.122:8080

> protonmail-web@3.16.20 poststart /private/tmp/WebClient
> npm run dev

βž™ Api: https://mail.protonmail.com/api

I can access to my account on http://localhost:8080. What's your browser ? Maybe the issue comes from a plugin ex: Β΅Matrix.

mauricioszabo commented 4 years ago

My env: Node: v12.13.0 NPM: 6.12.0 Ubuntu 18.04, using Brave Browser

I wasn't running the npm ci command. Now that I did, there's another issue on the console:

GET https://mail.protonmail.com/api/settings 401 (Unauthorized)
mail.protonmail.com/api/addresses:1 GET https://mail.protonmail.com/api/addresses 401 (Unauthorized)
mail.protonmail.com/api/settings/mail:1 GET https://mail.protonmail.com/api/settings/mail 401 (Unauthorized)
mail.protonmail.com/api/contacts/emails?PageSize=1000:1 GET https://mail.protonmail.com/api/contacts/emails?PageSize=1000 401 (Unauthorized)
mail.protonmail.com/api/auth/refresh:1 POST https://mail.protonmail.com/api/auth/refresh 400 (Bad Request)
networkActivityTracker.js?a074:30 
{data: {…}, status: 401, headers: Ζ’, config: {…}, statusText: "Unauthorized", …}

I expanded the last error and it shows this:


config: {method: "GET", transformRequest: Array(1), transformResponse: Array(1), paramSerializer: Ζ’, jsonpCallbackParam: "callback", …}
data: {Code: 401, Error: "Invalid access token", ErrorDescription: "", Details: {…}}
headers: Ζ’ (name)
noNotify: true
status: 401
statusText: "Unauthorized"
xhrStatus: "complete"
__proto__: Object```
dhoko commented 4 years ago

It's an issue with brave you need to change an option cf Screenshot from 2020-01-20 17-36-24

Select: All cookies allowed

It's something we need to do on localhost.