Authorization Code Flow

jea and i stuck at step 2, i’ll get redirect to the url but the question is what i’ve to do in the .php file to make it only accessible if your logged in (right now you can always reach it)