Skip to content

Exposing token-verifier for public use #325

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

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

websiddu
Copy link
Contributor

@websiddu websiddu commented Apr 6, 2025

Useful in special cases such as authorize the request websockets requests.

E.g use case,
Next app app authorizes using a firbease custom token, this custom token is sent to websoket server, with in the web socket server easy and lightweight way to authorize the user by validating the token createIdTokenVerifier wihout all the next js dependencies.

    const idTokenVerifier = createIdTokenVerifier("project-name");
    const decodedToken = await idTokenVerifier.verifyJWT(token, {});

    const { uid, name, exp, picture, email } = decodedToken;

Useful in special cases such as authorize the request websockets requests. 

E.g use case, 
Next app app authorizes using a firbease custom token, this custom token is sent to websoket server, with in the web socket server easy and lightweight way to authorize the user by validating the token `createIdTokenVerifier` wihout all the next js dependencies. 

```
    const idTokenVerifier = createIdTokenVerifier("project-name");
    const decodedToken = await idTokenVerifier.verifyJWT(token, {});

    const { uid, name, exp, picture, email } = decodedToken;
```
@awinogrodzki awinogrodzki changed the base branch from main to canary April 8, 2025 14:58
@awinogrodzki awinogrodzki merged commit d4c3eea into awinogrodzki:canary Apr 8, 2025
3 of 4 checks passed
@awinogrodzki
Copy link
Owner

awinogrodzki commented Apr 8, 2025

Hey @websiddu,

Thanks for the PR! I've released the changes in v1.10.0-canary.3

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