Skip to content

bearerSecret is empty when running application at first time #2267

@ebuildy

Description

@ebuildy

Description

Cannot SSO login:

secretOrPrivateKey must have a value (node_modules/jsonwebtoken/sign.js)
at SSOUtils.createJWT (cryptpad/plugins/sso/sso-utils.js)

Relate cryptpad/sso#11 but in my mind, the issue is in this project.

Root cause

This is because the Env.bearerSecret is empty https://github.com/cryptpad/cryptpad/blob/main/lib/env.js#L252, at init time, a secret is generated then save into decrees https://github.com/cryptpad/cryptpad/blob/main/lib/api.js#L98 (in file ./data/decrees/decree.ndjson) but not in Env.bearerSecret variable itself!

Steps to reproduce

Run cryptpad with sso plugin

Relevant logs

Expected behavior

After restart the container it works fine, I can login fine.

Which operating system are you using?

No response

What browsers are you seeing the problem on?

No response

Extensions

sso

Version

2026.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions