Nhost Dart & Flutter packages

Overview
Comments
  • Local stored refresh token not cleared when refresh token has expired

    Local stored refresh token not cleared when refresh token has expired

    https://github.com/nhost/nhost-dart/blob/ceb899f8a6f6907b845fe991a08c61e8ab78e672/packages/nhost_sdk/lib/src/auth.dart#L653

    In the case of when refresh token is expired and user is unable to auto login, the code tries to log the user out, however in the above line checks if the user is loggedIn or not. When the auto login in happening the state is not yet loggedId, it is inProgress and due to that, the refreshToken is not cleared from local storage. Moreover _loading flag is never set to false.

    Maybe the condition to early return should be modified/removed

    bug 
    opened by pjindal91 15
  • E-Mail Verification status as Authentication status

    E-Mail Verification status as Authentication status

    It would be a great help to be able to make use of the e-mail verification status in the auth part as authentication status, or a bool attached to the current user would be a great help for the overall auth process. Right now it seems there is only a way to read the ApiException message? Adding different status codes than 400 would help as well here in general. Many thanks!

    opened by MaxSchilling 10
  • Subscriptions are failing to update

    Subscriptions are failing to update

    This was originally reported by @escamoteur via Discord.

    After running the software, leaving it for a bit and coming back, subscriptions were no longer updating.

    This has been reported as happening on Windows, and macOS.

    bug 
    opened by shyndman 9
  • Latest version does no longer work on Flutter Web

    Latest version does no longer work on Flutter Web

    Hi,

    I got surprised this afternoon after a new deploy of the donation tracker suddenly no data at all got displayed. It works on Windows but not on web.

    opened by escamoteur 7
  • 404 Error when attempting to register a user with nhost_sdk.

    404 Error when attempting to register a user with nhost_sdk.

    I followed the simple auth example but when I actually run it and try to register a user, I get this error.

    ApiException(apiUrl=https://*uniqueID*.nhost.run/auth/register, statusCode=404, responseBody={path: $, error: resource does not exist, code: not-found})

    I am assuming it has something to do with me using an Nhost v2 address but I don't see a way of switching to v2 in the SDK. Thank you in advance.

    opened by erikmaddy 6
  • Return upload progress for fileupload

    Return upload progress for fileupload

    It would be great to have a callback to retrieve the upload progress of a file, to show it back to users. Firebase offered a subscription method to the upload progress, which was very helpful and user friendly.

    Thanks!

    enhancement 
    opened by MaxSchilling 6
  • upgrade nhost lints dependency

    upgrade nhost lints dependency

    Hi guys, could you please upgrade the lints dependency from nhost_sdk? I'm trying to use the nhost_sdk ^3.0.2 and it's not compatible with the most recent versions of flutter_lints and lints.

    Because no versions of flutter_lints match >2.0.1 <3.0.0 and flutter_lints 2.0.1 depends on lints ^2.0.0, flutter_lints ^2.0.1 requires lints ^2.0.0.
    And because nhost_sdk >=2.0.2 depends on lints ^1.0.0, flutter_lints ^2.0.1 is incompatible with nhost_sdk >=2.0.2.
    

    thank you

    bug 
    opened by marcusrohden 5
  • Change early return for clear session only if current state is alread…

    Change early return for clear session only if current state is alread…

    …y logged out

    Scope of change

    Right now as described in the issue https://github.com/nhost/nhost-dart/issues/32, if the refresh token expires then when the Auth is initialized, it is in AuthenticationState.inProgress state and since the refresh token is expired, the package tries to log the user out so that they can be logged in back which would generate a new refresh token. However due to the false early return condition the user doesn't fully get logged out, since the session is not clear and refresh token is not deleted from the local storage. This pr is to fix that and only do early return if the user already has been logged out before.

    Testing

    Unfortunately most of the authentication tests of this package are more integration tests than unit tests. Ideally i would like to be able to mock out the dependencies of Auth like authStore, session, httpClient, etc and make sure in unit tests that the correct methods of those dependencies are called. For example in this case make sure that session.clear is called and authStore.remove is called if the auth state is not loggedOut. However such tests do not exist right now.

    opened by pjindal91 5
  • Error propagation during refresh instead of silent failure

    Error propagation during refresh instead of silent failure

    Hi, previously it was discussed here that there is a design flaw in the library where it doesn't propagate the errors back to the client when exception happens during refresh of token. I am wondering if migration to version 2 is a good opportunity to do that as it might be a breaking change depending on how the library is redesigned.

    Example here, the exceptions are logged and not propagated to the client hence the client is eternally in AuthenticationState.inprogress state. In my previous project i overcame this limitation but by putting a time out on the application side but I think this should be fixed in the library.

    If the resdesign of the library is out of scope then one small enhancement we can make is just like we allow clients to add state change handlers, we can allow clients to register error callback handler, which can be called when the above exception happens with appropriate error message. Although its not a full proof solution since the application might not register with the error callback, it will atleast provide a way for the application to know that an exception happened underneath.

    Imo correct way would be to decouple initialization of Auth instance with refresh from here. I think we should let the client call a function refreshToken explicitly after they have initialized NhostClient and by extension Auth object. That way we can simply throw the exception from refreshToken function and client can handle it on their side.

    What do you think @shyndman? I am happy to work on this fix once we decide which approach to take.

    opened by pjindal91 4
  • Support full set of HTTP verbs when calling serverless functions

    Support full set of HTTP verbs when calling serverless functions

    Based on the discussion here, it seems there might be a gap in functionality of the SDK or maybe support for GET/DELETE has been removed in new version of nhost. In case, it is supported, then would make sense to have support for GET/DELETE as well in addition to POST. It might even be a breaking change based on the design of the solution hence might make sense to put in the v2 release.

    opened by pjindal91 4
  • Fix: Registration without auto-activated users bug

    Fix: Registration without auto-activated users bug

    Bugfix for https://github.com/nhost/nhost-dart/issues/6

    jwtToken and expiry date were't nullable and thus threw an error upon registration of users without auto-activation.

    opened by MaxSchilling 4
  • resetPassword: The value of

    resetPassword: The value of "options.redirectTo" is not allowed

    I'm getting this exception while trying to reset the password of a user:

    E/flutter (12035): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: ApiException: apiUrl=https://jixoaoumojenusgmwtfd.nhost.run/v1/auth/user/password/reset, statusCode=400, responseBody={status: 400, message: The value of "options.redirectTo" is not allowed., error: invalid-request}
    E/flutter (12035): #0      ApiClient._handleResponse (package:nhost_sdk/src/api/api_client.dart:281:7)
    E/flutter (12035): #1      ApiClient.send (package:nhost_sdk/src/api/api_client.dart:240:12)
    E/flutter (12035): <asynchronous suspension>
    E/flutter (12035): #2      AuthClient.resetPassword (package:nhost_sdk/src/auth_client.dart:450:5)
    E/flutter (12035): <asynchronous suspension>
    E/flutter (12035): #3      LoginEmailForgotController.submit (package:app/pages/login_email_forgot.dart:23:5)
    E/flutter (12035): <asynchronous suspension>
    E/flutter (12035):
    

    The code (at trace # 3) is the following submit method in my controller:

      Future<void> submit() async {
        NHostController nhc = Get.find();
        await nhc.client.auth.resetPassword(
            email: emailCtrl.value.text.trim(),
            redirectTo: '/app/login_email_forgot_change');
      }
    

    I think the code already complies with the usage of redirectTo as specified in the JavaScript reference.

    But for some reason it's still failing. The logs at NHost dashboard are very limited and not quite useful:

    2022-12-22 16:04:27 | hasura-auth | {"latencyInNs":4000000,"level":"info","message":"POST /user/password/reset 400 4ms","method":"POST","statusCode":400,"url":"/user/password/reset"}
    
    2022-12-22 16:03:25 | hasura-auth | {"latencyInNs":16000000,"level":"info","message":"POST /user/password/reset 400 16ms","method":"POST","statusCode":400,"url":"/user/password/reset"}
    

    Any pointers?

    bug 
    opened by diegonc 1
  • chore(sdk): Upgrade dependencies and SDKs constrain [Do not merge]

    chore(sdk): Upgrade dependencies and SDKs constrain [Do not merge]

    This PR will upgrade all dependencies and upgrade Flutter SDK constraint to 2.8.

    The branch will be used to release the following -dev versions nhost_sdk 4.0.0-dev.x nhost_flutter_auth 3.0.0-dev.x nhost_gql_links 2.0.5-dev.x nhost_graphql_adapter 3.0.0-dev.x nhost_flutter_graphql 3.0.0-dev.x

    opened by mhadaily 0
  • Add changePassword with Ticket for not logged in user

    Add changePassword with Ticket for not logged in user

    opened by lennyd7 0
  • oauth_providers_example.dart: example needs to be updated

    oauth_providers_example.dart: example needs to be updated

    The example's comments give wrong instructions regarding the configuration of NHost's OAuth callbacks:

    At line 10 it reads:

    /// Success redirect URL: `nhost-example://oauth.login.success`.
    /// Failure redirect URL: `nhost-example://oauth.login.failure`.
    

    wheareas only one callback URL can be set on GitHub settings and no URL can be set on NHost's GitHub provider configuration.

    Also at line 23, the sign in URL is wrong. It should look like:

    /// Fill in this value with the backend URL found on your Nhost project page.
    const nhostGithubSignInUrl = '$nhostUrl/v1/auth/signin/provider/github';
    
    bug documentation 
    opened by diegonc 4
Neumorphic Sign In And Sign Up UI with no packages

Neumorphic SignIn And SignUp Watch it on YouTube Neumorphic Login UI using flutter,This project consist of two screen, SignIn Screen and SignUp Screen

Sayuj Sujeev 11 Aug 2, 2022
A Dart library for creating a Dart object to represent directory trees.

Directory Tree A Dart library for creating a Dart object to represent directory trees. Getting Started Import and initialize package import 'package:d

Chiziaruhoma Ogbonda 5 Dec 1, 2021
A collection of Dart code samples by Dart DevRel

Dart samples A collection of Dart programs that illustrate features and best practices. For a list of community-maintained projects, see Awesome Dart.

Dart 458 Dec 30, 2022
A discord bot, made with Dart, which lets you run your own pure Dart code snippets directly via a discord ping, and get the output in an instant.

A discord bot, made with Dart, which lets you run your own pure Dart code snippets directly via a discord ping, and get the output in an instant.

Anikate De 3 Oct 21, 2022
Stream Feed official Flutter SDK. Build your own feed experience using Dart and Flutter.

Official Flutter packages for Stream Activity Feeds The official Dart client for Stream Activity Feeds, a service for building activity feed applicati

Stream 67 Sep 26, 2022
Expenses tracker built with Flutter and Dart making use of Provider, Intl, Syncfusion Flutter Datepicker and more

expense_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if t

Atuoha Anthony 2 Dec 10, 2022
Pensil Community official Flutter SDK. Build your own community experience using Dart and Flutter.

Official flutter package for Pensil The official Dart client for Pensil communities, a service for building communites applications. This library can

Pensil Inc 6 Oct 6, 2022
A multiplatform Dart movie app with 40% of code sharing between Flutter and the Web.

A multiplatform Dart movie app with 40% of code sharing between Flutter and the Web.

Iiro Krankka 3.4k Dec 30, 2022
GChat is a chatting application developed using Flutter(Dart) and firebase for 2 users. Trying to Develop an application that does not sell your data with whatsapp rolling out its privacy policy updates.

Gchat - The Chatting Application A Flutter project for chatting. I used Android Studio and you can you any editor of your choice for ex: VS Code, Inte

Sanchaksh Kaul 6 Nov 6, 2022
A simple app to keep track the time you Learn, Playing, Reading, ... in every week. This is also my attempt to teach myself Flutter & Dart

Progressor 0.0.1 Sometime you want to set a target for you weekly, for example: "Reading Book for 8 hours every week". This app helps you to do that.

Son Nguyen Hoang 4 Oct 12, 2022
This is a fully fledged Sudoku game written in Dart using Flutter.

This is a fully fledged Sudoku game written in Dart using Flutter.

Varun Shanbhag 56 Dec 29, 2022
Software of Application using Dart, Flutter, Kotlin,Swift,Objective-C, and NodeJS

TouchMe-MobileApp-Dart-And-Flutter Description Software of Application using Dart, Flutter and Kotlin. Installation Using Dart 2.13.1, Flutter 2.2.1,

Daniel Arturo Alejo Alvarez 7 Nov 9, 2021
A Dart/Flutter package to register/query/remove URI Schemes without hassle.

protocol_registry Register/query/remove URI Schemes without hassle. Available for Windows and Linux. Installation flutter pub add protocol_registry Us

ZYROUGE 10 Oct 25, 2022
Applicazione mobile multipiattaforma sviluppata in Flutter e Dart che permette di visionare i dati relativi al carico di pazienti presenti nei pronto soccorso degli ospedali dell'area metropolitana di Genova.

Genova PS Applicazione mobile multipiattaforma sviluppata in Flutter e Dart che permette di visionare i dati relativi al carico di pazienti presenti n

Riccardo Riggi 1 Oct 19, 2021
UI design for mobile, create using visual studio code & flutter dart programming languange

HCIProjectLab A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

null 1 Oct 13, 2021
Routinger is a task scheduler app that is made to make you a better person at no extra cost. The code is open-source. Dart language and Flutter framework are used extensively.

Routinger This is a simple app that will allow you to schedule your tasks, create a simple to-do, and also make recurring tasks. The app ends you noti

Routinger 16 Dec 17, 2022
This is a weather app created in Flutter with backend in Dart

Flutter Weather A Flutter application to view current weather status. Features ✅ Beautiful minimal UI ✅ Dark and Light themes ✅ Current temperature, m

null 2 Jul 4, 2022
Elpee is a multiplatform app written entirely in Dart/Flutter.

elpee - Explore and share music About Elpee is a multiplatform app written entirely in Dart/Flutter. The data is retrieved from the Spotify Web API an

Tom van Lieshout 86 Oct 25, 2022
An open source task manager (todo list) app, developed using Dart language and Flutter framework.

Tasker An open source task manager (todo list) app, developed using Dart language and Flutter framework. Screenrecords     Screenshots                

Erfan Rahmati 42 Dec 29, 2022