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

29/Remove token #56

Merged
merged 7 commits into from
Sep 27, 2021
Merged

29/Remove token #56

merged 7 commits into from
Sep 27, 2021

Conversation

dgrcode
Copy link
Collaborator

@dgrcode dgrcode commented Sep 27, 2021

Fix #29

As stated in #29:

After the changes introduced in #44 and #46, there's no longer need for JWTs. This issue is going to be used to remove jwt usage instead of refreshing them.

Opening the PR against the branch for #46 because that branch will need these changes.

I left a dummy middleware alerting that admins are not checked anymore. That should be solved in #51.

@@ -7,9 +7,15 @@ const bodyParser = require("body-parser");
// Firebase set up
const firebaseAdmin = require("firebase-admin");
const firebaseServiceAccount = require("./firebaseServiceAccountKey.json");
const { userOnly, adminOnly } = require("./middlewares/auth");
const { withAddress } = require("./middlewares/auth");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another idea for this middleware name: withProviderAddress

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provider sounds a bit too ambiguous to me. What about withConnectedAddress or withWalletAddress?

Copy link
Collaborator

@carletex carletex Sep 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposed «provider» since it's how it's called on the frontend (userProvider, injectedProvider, localProvider). But I like withConnectedAddress also.

@carletex carletex merged commit f177d50 into 46/public-url Sep 27, 2021

req.address = addressToken;
req.isAdmin = tokenContents.claims.isAdmin;
const withAddress = (req, res, next) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we want to return a 401 (or other error status code) if the address is not present?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, makes sense. We can tackle the two comments on the open PR #55

@dgrcode dgrcode deleted the 29/refresh-token branch September 28, 2021 07:13
@dgrcode dgrcode mentioned this pull request Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants