Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify profile auth & signature flow #2012

Merged
merged 25 commits into from
Jan 30, 2024
Merged

Conversation

Atmosfearful
Copy link
Collaborator

@Atmosfearful Atmosfearful commented Dec 11, 2023

Description

As we prepare for wallet abstraction (web2 auth) this old JWT verification method should be deprecated.

Switched to a more straightforward signature + nonce approach for every request.

Old way

/verify was used to verify a users signature and mint a JWT for the session
The JWT was included in the edit requests

New way

POST and PUT requests expect an Authorization header which should include a signed message.
The string to be signed is included as a vercel env var, and will be shared with the frontend

Note

The frontend needs to be updated to consume v3.0.0 and pass the signature to the header.

QA

User with a nonce:
https://carbonmark-api-git-atmos-simplify-auth-klimadao.vercel.app/users/atmosfearful

User without a nonce (backwards compat)
https://carbonmark-api-git-atmos-simplify-auth-klimadao.vercel.app/users/jabby

Copy link

vercel bot commented Dec 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
carbonmark ✅ Ready (Inspect) Visit Preview Jan 30, 2024 5:37am
carbonmark-api ✅ Ready (Inspect) Visit Preview Jan 30, 2024 5:37am
demo-integration ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 30, 2024 5:37am
klimadao-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 30, 2024 5:37am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
carbon ⬜️ Ignored (Inspect) Visit Preview Jan 30, 2024 5:37am

carbonmark-api/src/routes/users/post.schema.ts Outdated Show resolved Hide resolved
carbonmark-api/src/routes/users/put.ts Outdated Show resolved Hide resolved
carbonmark-api/src/routes/users/put.ts Outdated Show resolved Hide resolved
carbonmark-api/src/utils/firebase.utils.ts Outdated Show resolved Hide resolved
carbonmark-api/src/utils/firebase.utils.ts Outdated Show resolved Hide resolved
carbonmark-api/src/routes/users/post.ts Outdated Show resolved Hide resolved
carbonmark-api/src/routes/users/put.ts Outdated Show resolved Hide resolved
carbonmark-api/src/app.constants.ts Outdated Show resolved Hide resolved
carbonmark-api/src/models/User.model.ts Show resolved Hide resolved
@Atmosfearful
Copy link
Collaborator Author

Oh no... tests pass locally but not remotely... nightmare scenario. Will look deeper tmr

@Atmosfearful Atmosfearful deployed to Preview – carbonmark-api December 20, 2023 05:06 — with GitHub Actions Active
@Atmosfearful Atmosfearful deployed to Preview – carbonmark-api December 20, 2023 05:08 — with GitHub Actions Active
@Atmosfearful Atmosfearful changed the title Atmos/simplify auth Simplify profile auth & signature flow Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants