Open Austin2Shih opened 6 months ago
[ ] async verifyAuthToken, Create in _datalib/auth
takes in JWT token and returns {ok: bool, body: decoded_data, error: null}
Verify the token using the tokenSecret
Verify that the token has not expired yet
If checks pass then return {ok: true, body: decoded_data, error: null} or else return {ok: false, body: null, error: err.msg}
[ ] async VerifyAuthToken (returns the value of verifyAuthToken from lib), Create in _actions/auth
Server action that takes in the auth token: "auth_token" from cookies
Call and return the value of verifyAuthToken (passing in the JWT token from cookies)
[ ] async verifyAuthToken, Create in _datalib/auth
takes in JWT token and returns {ok: bool, body: decoded_data, error: null}
Verify the token using the tokenSecret
Verify that the token has not expired yet
If checks pass then return {ok: true, body: decoded_data, error: null} or else return {ok: false, body: null, error: err.msg}
[ ] async VerifyAuthToken (returns the value of verifyAuthToken from lib), Create in _actions/auth
Server action that takes in the auth token: "auth_token" from cookies
Call and return the value of verifyAuthToken (passing in the JWT token from cookies)