# Questions Related to Before/After Authentification Hook functions

**URL:** <https://forum.heroiclabs.com/t/questions-related-to-before-after-authentification-hook-functions/287>\
**Category:** Local Setup\
**Tags:** authentication\
**Created:** [October 20, 2019, 9:30pm UTC](https://forum.heroiclabs.com/t/questions-related-to-before-after-authentification-hook-functions/287 "2019-10-20T21:30:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![hdjay0129](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/hdjay0129/32/1103_2.png) [@hdjay0129](https://forum.heroiclabs.com/u/hdjay0129)\
**Post date:** [October 21, 2019, 10:41am UTC](https://forum.heroiclabs.com/t/questions-related-to-before-after-authentification-hook-functions/287/2 "2019-10-21T10:41:24Z")

</div>

Hi @Opeth001,  
You can check out this [A way to know if a user is doing a sign in or sign up from google login](https://forum.heroiclabs.com/t/a-way-to-know-if-a-user-is-doing-a-sign-in-or-sign-up-from-google-login/279) post . I think it’ll answer most of your queries -

Also I’ll try to answer your queries here from my understanding of nakama,  
1 - You can send the custom values with authentication request and access them inside the payload received in before hook. I think it’s not available yet on client side. Check out that post for more info and someone on the nakama team can clarify that for you.  
2. Authentication before hook is triggered before authentication process even starts. Before hook for any type of request always executes first. If you don’t return the payload from before hook, request is not performed and returns back to client with error.  
3. No, you can’t know that in before hook as authentication is not done in before hook unless you make a custom SQL call to db to know that which is not very efficient. But yes, you can know that inside the after hook, check for session object’s `Created` field for that.  
4. Yes, you can access the initial request payload passed inside the after hook. Check here [https://heroiclabs.com/docs/runtime-code-basics/#after-hook](https://heroiclabs.com/docs/runtime-code-basics/#after-hook)  
5. As far as I understood, that metadata is related to wallet transaction. You can store custom info regarding a particular wallet transaction inside that metadata field.

I hope this helps.

---

_[View the full topic](https://forum.heroiclabs.com/t/questions-related-to-before-after-authentification-hook-functions/287)._
