Skip to content

Instantly share code, notes, and snippets.

View 91pavan's full-sized avatar

Pavan Sudheendra 91pavan

  • Cisco Systems
View GitHub Profile
@soulmachine
soulmachine / jwt-expiration.md
Last active April 9, 2024 04:12
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 6, 2024 02:17
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@91pavan
91pavan / zipdict.py
Last active December 18, 2015 10:49
Convert a list into dictionary and dictionary into lists!
def zipdict(names, values):
return dict(zip(names, values))
def unzipdict(mydict):
list1 = mydict.keys()
list2 = mydict.values()
return list1, list2