# Totally mixed as a newbie in my first application

**URL:** <https://community.auth0.com/t/totally-mixed-as-a-newbie-in-my-first-application/96299>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [December 12, 2022, 8:12pm UTC](https://community.auth0.com/t/totally-mixed-as-a-newbie-in-my-first-application/96299 "2022-12-12T20:12:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bozden](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bozden/32/36016_2.png) [@bozden](https://community.auth0.com/u/bozden)\
**Post date:** [December 13, 2022, 5:48am UTC](https://community.auth0.com/t/totally-mixed-as-a-newbie-in-my-first-application/96299/2 "2022-12-13T05:48:19Z")

</div>

If I’m not implementing a total mess, I might have found a solution…

First of all, this helped me a lot:

> [@How to use a token with axios?](https://community.auth0.com/t/how-to-use-a-token-with-axios/63171/15):
>
> Thanks for confirming. I’ve played around with this a bit and I think because useAxios is a hook, it would be challenging to use this with getAccessTokenSilently since you can’t use a hook within useEffect. You may need to use Axios alone within useEffect so that you can get the accessToken before making the request: import React, { useEffect, useState } from "react"; import { Container, Row, Col } from "reactstrap"; import Highlight from "../components/Highlight"; import { useAuth0, withAuthe…

I had axios, and on top of that useApi custom hooks as react-query implementations. Under the useApi I could use my custom useAuthToken hook which gets the token. But, there, if the user is not logged in, I set it to an empty string (in catch error) and do not send a bearer token through axios.

On the server side, to not duplicate every route, I cannot use protected routes and cannot use the auth0.middleware in examples directly. I think I need to implement special code to get the logged in status and decide the database queries checking that status. I wonder if I can also use the scopes in here, such as read:public, read:moderator etc…

Any insight is very much welcome.

---

_[View the full topic](https://community.auth0.com/t/totally-mixed-as-a-newbie-in-my-first-application/96299)._
