chyiiiiiiiiiiii / flutter_zendesk_messaging

Zendesk-Messaging for Flutter developer
Apache License 2.0
31 stars 46 forks source link

Field to check if user is logged in #28

Closed qwaiks closed 10 months ago

qwaiks commented 1 year ago

Can we have a field to check if the is logged in.

DouglasValerio commented 1 year ago

@qwaiks Do you still need this feature? It seems like a straightforward implementation, so I could give it a try if you're still in need of that

DouglasValerio commented 1 year ago

@chyiiiiiiiiiiii Do you think a loggedIn getter is a worthy addition to the package? Personally, I think one could easily keep track of the auth state of the user in their own Flutter implementation, using the result of the login() method, once the auth state survives the entire lifecycle of the app.

qwaiks commented 1 year ago

yeah that makes sense and seems fairly easy to implement. think it would come in handy for the community. theres currently an error that thrown when the logout() is called and the sign in fails.

DouglasValerio commented 1 year ago

@qwaiks Could you provide more info on the exception thrown in this case? Maybe we should address this case too

chyiiiiiiiiiiii commented 1 year ago

Yeah, sure. The state-getter is helpful. We could have check functions.

qwaiks commented 1 year ago

@qwaiks Could you provide more info on the exception thrown in this case? Maybe we should address this case too

It throws an exception with the message "Zendesk::logoutUser Failed" thats because the user is not signed in _Exception (Exception: Zendesk::logoutUser failed)

DouglasValerio commented 1 year ago

@qwaiks Could you provide more info on the exception thrown in this case? Maybe we should address this case too

It throws an exception with the message "Zendesk::logoutUser Failed" thats because the user is not signed in _Exception (Exception: Zendesk::logoutUser failed)

I would argue that this exception is being thrown as expected, nevertheless, just opened a PR adding the login status checker: https://github.com/chyiiiiiiiiiiii/flutter_zendesk_messaging/pull/33 Let me know if this solves your use case