Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nhost_flutter_auth): Allow displayName and locale to be passed on signInAnonymous #131

Merged

Conversation

sl1mpshady
Copy link
Contributor

@sl1mpshady sl1mpshady commented Jan 26, 2024

Added this PR with regards to https://github.com/nhost/hasura-auth/blob/main/src/routes/signin/anonymous.ts that allows user to send displayName and locale to override the default "Anonymous User". Also, session should be set after signing in.

@sl1mpshady
Copy link
Contributor Author

How to make the checks pass?

Run PERCENTAGE=$((( $TOTAL ) * 100 / ( $TOTAL_MAX - ${MAX_PANA_MISSING_POINTS:-10} )))
  PERCENTAGE=$((( $TOTAL ) * 100 / ( $TOTAL_MAX - ${MAX_PANA_MISSING_POINTS:-10} )))
  if (( $PERCENTAGE < 100 ))
  then
    echo "Score to low ($TOTAL/$TOTAL_MAX)."
    exit 1
  fi
  shell: /usr/bin/bash -e {0}
  env:
    TOTAL: 1[2](https://github.com/nhost/nhost-dart/actions/runs/7671882054/job/21057417995?pr=131#step:6:2)0
    TOTAL_MAX: 1[4](https://github.com/nhost/nhost-dart/actions/runs/7671882054/job/21057417995?pr=131#step:6:4)0
Score to low ([12](https://github.com/nhost/nhost-dart/actions/runs/7671882054/job/21057417995?pr=131#step:6:13)0/140).
Error: Process completed with exit code 1.

Future<void> signInAnonymous(
String? displayName,
String? locale,
) async {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would you mind adding metadata too now that we are at it? Should just be an arbitrary map.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metadata is ignored at the moment on nhost hasura_auth, so metadata will not be saved on user's side. but i added it just in case in the future hasura_auth will allow sending the metada for signing in anonymously.

@dbarrosop

@sl1mpshady
Copy link
Contributor Author

Added metadata and also modified the function to set the session after api call. @dbarrosop

@onehassan onehassan merged commit 017bcc5 into nhost:main Feb 6, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants