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

Feature : Checking if the auth token has expired #206

Open
epicadk opened this issue Mar 6, 2021 · 15 comments
Open

Feature : Checking if the auth token has expired #206

epicadk opened this issue Mar 6, 2021 · 15 comments
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. hacktoberfest Status: Available Issue was approved and available to claim or abandoned for over 3 days. Type: Enhancement New feature or request.
Projects

Comments

@epicadk
Copy link
Member

epicadk commented Mar 6, 2021

Is your feature request related to a problem? Please describe.

Currently, we send all auth tokens to the MS-backend. However if we check if the auth token has expired or not before sending it to the MS-backend then it would reduce the load and also limit our calls to the MS-backend.

Describe the solution you'd like

Check if the Auth token has expired. And if it has send a 401 response to the user.

Additional context

There is an open pr for tsomething similar on the MS-android repo as well.

@welcome
Copy link

welcome bot commented Mar 6, 2021

Hello there!👋 Welcome to the project!💖

Thank you and congrats🎉for opening your very first issue in this project. AnitaB.org is an inclusive community, committed to creating a safe and positive environment.🌸 Please adhere to our Code of Conduct.🙌 You may submit a PR if you like! If you want to report a bug🐞 please follow our Issue Template. Also make sure you include steps to reproduce it and be patient while we get back to you.😄

Feel free to join us on AnitaB.org Open Source Zulip Community.💖 We have different streams for each active repository for discussions.✨ Hope you have a great time there!😄

@epicadk epicadk added Category: Coding Changes to code base or refactored code that doesn't fix a bug. Type: Enhancement New feature or request. Status: On Hold Issue or PR needs more info, a discussion, a review or approval from a Maintainer/Code Owner. labels Mar 6, 2021
@epicadk
Copy link
Member Author

epicadk commented Mar 6, 2021

Marking this as status on hold as this needs to be approved by @mtreacy002.

@mtreacy002
Copy link
Member

@epicadk , can you please share the link to the similar issue on the MS Android so I can check it out?

@epicadk
Copy link
Member Author

epicadk commented Mar 6, 2021

Sure , here it is. Although that is only a small part of the pr. I Think it is on line 50 in the network interceptor file :) .

@mtreacy002
Copy link
Member

I'm thinking if we could do the same so instead of checking the token expiry on BIT backend, we can do that on BIT web, that way we don't need to send request from frontend if token is expired. We just need to ask user to login again on frontend. What do you think, @epicadk ?

@epicadk
Copy link
Member Author

epicadk commented Mar 6, 2021

I'm thinking if we could do the same so instead of checking the token expiry on BIT backend, we can do that on BIT web, that way we don't need to send request from frontend if token is expired. We just need to ask user to login again on frontend. What do you think, @epicadk ?

I agree but since it is a rest api and a user does not necessarily need to use the BIT front-end I still think it makes sense to add a check to the BIT backend.

@mtreacy002
Copy link
Member

That makes sense, it'll be good for the backend developers so it reminds them that token is expired meaning they need to login again 👍. Ok. will approve this issue now. Would you like to work on this, @epicadk ?

@mtreacy002 mtreacy002 removed the Status: On Hold Issue or PR needs more info, a discussion, a review or approval from a Maintainer/Code Owner. label Mar 6, 2021
@epicadk
Copy link
Member Author

epicadk commented Mar 6, 2021

That makes sense, it'll be good for the backend developers so it reminds them that token is expired meaning they need to login again 👍. Ok. will approve this issue now. Would you like to work on this, @epicadk ?

Yep, I'd like to work on this. : )

@epicadk
Copy link
Member Author

epicadk commented Mar 6, 2021

Although it might take a while because I have to set the project up locally. I hope that's okay : ).

@mtreacy002
Copy link
Member

mtreacy002 commented Mar 6, 2021

Assigning you now 😉. Take your time. Just don't forget to give update every 3-4 days.

@epicadk
Copy link
Member Author

epicadk commented Mar 8, 2021

Making this issue available as I have to work on other action items.

@epicadk epicadk removed their assignment Mar 8, 2021
@epicadk epicadk added the Status: Available Issue was approved and available to claim or abandoned for over 3 days. label Mar 8, 2021
@Rahulm2310
Copy link
Contributor

@epicadk @mtreacy002 I would like to try this 🙂

@epicadk
Copy link
Member Author

epicadk commented Mar 9, 2021

@epicadk @mtreacy002 I would like to try this 🙂

Assigning you good luck. 👍🏼

@epicadk epicadk removed the Status: Available Issue was approved and available to claim or abandoned for over 3 days. label Mar 9, 2021
@mtreacy002
Copy link
Member

mtreacy002 commented Mar 9, 2021

@Rahulm2310 , you're currently assigned to BIT web issue #155 and haven't submitted a PR for a review. Can you please focus on that one first? cc @epicadk

@mtreacy002 mtreacy002 added the Status: Available Issue was approved and available to claim or abandoned for over 3 days. label Mar 9, 2021
@epicadk
Copy link
Member Author

epicadk commented Mar 10, 2021

@Rahulm2310 , you're currently assigned to BIT web issue #155 and haven't submitted a PR for a review. Can you please focus on that one first? cc @epicadk

Oh I thought it was one issue per repository. I'll keep this in mind next time. : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. hacktoberfest Status: Available Issue was approved and available to claim or abandoned for over 3 days. Type: Enhancement New feature or request.
Projects
BIT Roadmap
New Issues
Development

No branches or pull requests

5 participants