UNLV-CS472-672 / 2024-S-GROUP5-Munch

The Munch app is a social platform where users create profiles by selecting preferred foods.
1 stars 11 forks source link

Fixing Token Decoding Issue #61 #62

Closed rparker2003 closed 5 months ago

rparker2003 commented 5 months ago

Closes #61

Description / Changes Made

How to Test

  1. Add following code into frontend/app/(tabs)/index.tsx at the top of the export function Index():

    const { getToken } = useAuth();
    
    useEffect(() => {
    (async () => {
      const token = await getToken();
      console.log(token);
    })();
    }, []);

    You must also add the respective imports for the above code:

    import { useAuth } from '@clerk/clerk-expo';
    import { useEffect } from 'react';
  2. Start the front end, and after logging in through the profile page, you will see the JWT token logged to the console.
  3. Add the prefix "Bearer " to the newly created JWT token in the Authentication header in Postman, and test any routes.
  4. (Optional) You can put the newly created JWT token in to https://jwt.io to verify the JWT token has a "sub" field instead of a "uid" field.

Checklist