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/auth via supabase #555

Merged
merged 141 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
982791e
feat(auth): Working auth using supabase
ff6347 Mar 20, 2023
2e4261b
refactor(api routes): Match routes of new api
ff6347 Mar 21, 2023
2d7b9c4
refactor: Example error messaging
ff6347 Mar 21, 2023
65a0da2
chore: Mark functions as deprecated
ff6347 Mar 21, 2023
5ddf090
refactor(getUserData): User data exists already
ff6347 Mar 21, 2023
145b8a2
refactor(getUserData): User data exists already
ff6347 Mar 21, 2023
c486379
refactor: Remove from deprecated functions
ff6347 Mar 21, 2023
a10479e
feat(hooks): Add supabase hooks
ff6347 Mar 21, 2023
d68c0f0
feat: Redirect to auth component
ff6347 Mar 21, 2023
fb15959
feat: Logged in user can delete their account
ff6347 Mar 21, 2023
a1e6eb8
docs: Remoce Auth0 credentials from env.example
ff6347 Mar 21, 2023
4ff63ee
docs: Update .env.example with SUPABASE vars
ff6347 Mar 21, 2023
1f6c722
fix: Error paste sql function
ff6347 Mar 21, 2023
8124ca0
feat: Update username on trees_watered
ff6347 Mar 21, 2023
76230ee
chore: Remove unneccesary code
ff6347 Mar 22, 2023
57dd738
refactor(auth): Split large component
ff6347 Mar 22, 2023
be534c2
refactor: Housekeeping
ff6347 Mar 22, 2023
9729987
refactor: Remove auth0 context
ff6347 Mar 22, 2023
27d3aa9
fix: Small error. Import React
ff6347 Mar 22, 2023
901e215
refactor: Remove auth0 context
ff6347 Mar 22, 2023
1b57979
feat: Add link to auth section
ff6347 Mar 22, 2023
066de9d
refactor: Remove loading state.
ff6347 Mar 22, 2023
e3a9fcc
feat(Notifications): Make notifictions centralized
ff6347 Mar 22, 2023
b30c915
fix(SidebarProfile): Loading state
ff6347 Mar 23, 2023
8cb9190
feat(Signin): Send user to profile after signin
ff6347 Mar 23, 2023
1dc21f3
chore: Housekeeping
ff6347 Mar 23, 2023
aceff6e
chore: Housekeeping remove auth0 related stuff
ff6347 Mar 23, 2023
233913f
chore: Housekeeping
ff6347 Mar 23, 2023
dee4f44
chore: Use existing session on entry
ff6347 Mar 23, 2023
e6e5fb8
feat: Add expandable panels
ff6347 Mar 23, 2023
be8e44c
style: Some small paragraphs
ff6347 Mar 23, 2023
a328ddd
Merge branch 'staging' of github.com:technologiestiftung/giessdenkiez…
ff6347 Mar 24, 2023
a789dbe
Merge branch 'staging' into feat/auth-via-supabase
ff6347 Mar 24, 2023
fcfa790
fix(Notification): Show also on pw reset form
ff6347 Mar 24, 2023
ce3012f
feat(PW Reset): Force user to provide old PW
ff6347 Mar 24, 2023
758388a
feat(Notification):Extend Notification w meta data
ff6347 Mar 24, 2023
868806d
ci: Update action with needed env vars
ff6347 Mar 24, 2023
827e5b3
fix: Label ref and add tests
ff6347 Mar 24, 2023
2969dad
test(SidebarAuth): Recovery and signup
ff6347 Mar 24, 2023
c364846
chore: Move components around for better reusage
ff6347 Mar 27, 2023
a36e850
chore: Move components around for better reusage
ff6347 Mar 27, 2023
45a312e
test: Stories for existing modals
ff6347 Mar 27, 2023
d2e53fb
chore: Move components around for better reusage
ff6347 Mar 27, 2023
8247caf
chore: REmove unused hook
ff6347 Mar 27, 2023
59bf922
chore: Remove logging
ff6347 Mar 27, 2023
d573200
refactor: Change useSupabaseProfile hook into useUserProfile
ff6347 Mar 27, 2023
aa1d5bd
refactor: Change useSupabaseProfile hook into useUserProfile
ff6347 Mar 27, 2023
9a7a3bc
feat: Edit account in modal
ff6347 Mar 27, 2023
7322445
chore: Remove logging
ff6347 Mar 27, 2023
5f9ad80
fix(Submit button): Did not show on mobile
ff6347 Mar 27, 2023
5112ef6
fix(profile): Not finished loading when logged out
ff6347 Mar 27, 2023
f403b0f
refactor(recovery): Create form for pw recovery
ff6347 Mar 27, 2023
476a1ce
refactor: Move and remove components for reuse
ff6347 Mar 28, 2023
4714b28
refactor: Move interfaces
ff6347 Mar 28, 2023
de59071
refactor: Move and remove components for reuse
ff6347 Mar 28, 2023
1781eb0
refactor: Move and remove components for reuse
ff6347 Mar 28, 2023
b1d78ef
feat: Passwordvalidation component
ff6347 Mar 28, 2023
57d32ed
refactor(password validation): Move to own function
ff6347 Mar 28, 2023
92b7e99
feat(password edit): Allow password edit from profile
ff6347 Mar 28, 2023
f1e8f7a
refactor(passowrd): Move edits to profile
ff6347 Mar 28, 2023
e59d175
refactor(Modal): Move forms to their own components
ff6347 Mar 28, 2023
6326213
fix: Error about forward ref on function component
ff6347 Mar 28, 2023
a1c1445
test(password): Make test match new function sig
ff6347 Mar 28, 2023
dbdf51a
refactor: Elevate state to HOC
ff6347 Mar 28, 2023
56bdd24
chore: Typo in function name
ff6347 Mar 28, 2023
485aa27
feat: Notify users of errors
ff6347 Mar 28, 2023
a4af19d
refactor: Elevate state to HOC
ff6347 Mar 28, 2023
a9aed50
chore: Remove dead code
ff6347 Mar 29, 2023
3f5500c
fix(Recovery): Password is validated against pattern
ff6347 Mar 29, 2023
fb38631
trying to fix notification beeing null on password compare
ff6347 Mar 29, 2023
f13daa0
fix: check password equality first
dnsos Apr 12, 2023
b6c00c9
docs: demonstrate that new session unmounts PasswordEditForm
dnsos Apr 13, 2023
40afe69
Revert "docs: demonstrate that new session unmounts PasswordEditForm"
dnsos Apr 13, 2023
75f3eca
fix: validate password without persisting new session (if validation …
dnsos Apr 13, 2023
7a1e6cf
fix: remove loading text in submit button after password change attempt
dnsos Apr 13, 2023
cb5ed29
refactor: extract updatePassword to util
dnsos Apr 14, 2023
fe00655
style: make modal content style more flexible
dnsos Apr 14, 2023
5a59c28
refactor: tidy up password edit form
dnsos Apr 14, 2023
c11078a
feat: create modal with success view
dnsos Apr 14, 2023
e4e77b6
feat: ensure new password is different than old
dnsos Apr 14, 2023
59bf110
chore: housekeeping
dnsos Apr 14, 2023
4f3b947
refactor: use account edit modal only for account
dnsos Apr 14, 2023
84ab4ca
Merge pull request #562 from technologiestiftung/fix/edit-password
ff6347 Apr 14, 2023
2a1d2f0
refactor: extract requests to Supabase
dnsos Apr 19, 2023
2a7bdb8
feat: wrap account updates in wrapper
dnsos Apr 19, 2023
4ff3975
docs: provide hint that function is a wrapper
dnsos Apr 19, 2023
d2ead9b
feat: use correct wording in e-mail change message
dnsos Apr 19, 2023
c49d6b1
feat: implement user flow for error/success messages
dnsos Apr 19, 2023
6f87fd3
style: increase spacing between success messages and close button
dnsos Apr 19, 2023
38fa6ca
feat: display success notifications also when there is an error in th…
dnsos Apr 19, 2023
aa611f1
style: adjust vertical spacing between notifications
dnsos Apr 19, 2023
eb551f5
chore: provide fallback error message
dnsos Apr 20, 2023
5ff0088
Merge pull request #569 from technologiestiftung/refactor/edit-account
dnsos Apr 20, 2023
e6456b9
Merge branch 'staging' into feat/auth-via-supabase
ff6347 Apr 20, 2023
99a29df
chore: Fix typo
ff6347 Apr 20, 2023
feeb5b3
chore: Replace spaces with tabs
ff6347 Apr 20, 2023
ae4abdd
fix: prevent signed-in auth view from flashing
dnsos Apr 20, 2023
0ae4f3d
ci(actions): Fix error in workflow : instead of =
ff6347 Apr 20, 2023
3b4b063
fix: added missing space
raphael-arce Apr 20, 2023
ed9a520
Merge pull request #572 from technologiestiftung/fix/signin-loading-s…
dnsos Apr 21, 2023
bb87be2
feat: added password validation for signup
raphael-arce Apr 21, 2023
85d401e
refactor: move recovery auth redirect url to env
raphael-arce Apr 21, 2023
c0be3b1
refactor: replaced dupplicate url with env variable
raphael-arce Apr 28, 2023
d4f3de0
Merge pull request #573 from technologiestiftung/feat/add-signup-pass…
raphael-arce May 5, 2023
da353ed
Merge branch 'staging' into feat/auth-via-supabase
ff6347 May 5, 2023
0cebb81
ci: fix test remove duplicate env vars
ff6347 May 5, 2023
9ababdc
docs: Added new env var to vercel and test.yml
ff6347 May 8, 2023
f8caf98
feat(UserNotification): Allow React.CSSProperties
ff6347 May 8, 2023
a4ae9c0
fix: Replace error message with UserNotification
ff6347 May 8, 2023
6a6e169
fix(auth): Add confirm view
ff6347 May 9, 2023
412c230
fix: Add typogrfically correct quotes for de
ff6347 May 9, 2023
f14d12e
fix: Use the right quotes
ff6347 May 9, 2023
20aa7fc
style: Add spacer between text and notification
ff6347 May 9, 2023
c246796
chore: Add FROM_EMAIL as env var
ff6347 May 9, 2023
35c36d3
chore: Fix typo and remove dead code
ff6347 May 9, 2023
0d6ab65
Merge pull request #575 from technologiestiftung/docs/env-vars_recove…
ff6347 May 9, 2023
9f77aef
Merge pull request #576 from technologiestiftung/fix/watering-modal-n…
ff6347 May 9, 2023
dea9634
feat(Quotes): Adds function for quoting
ff6347 May 10, 2023
61a757b
feat: Add user email to default text
ff6347 May 10, 2023
b24b68c
feat: Add user email to default text
ff6347 May 10, 2023
dd82aa0
fix: Revert changes to recovery notification
ff6347 May 10, 2023
35f20e0
Merge pull request #577 from technologiestiftung/fix/auth-confirm
ff6347 May 10, 2023
fb4c070
feat: removed error notification on email duplicate
raphael-arce May 10, 2023
4828252
Merge pull request #579 from technologiestiftung/feat/remove-error-ms…
ff6347 May 11, 2023
8c7dc03
fix(Quotes): Can't use html entities in string
ff6347 May 11, 2023
7f4a021
fix(Quotes): Replace " and EN quotes with DE quotes
ff6347 May 11, 2023
b2a9414
Merge pull request #580 from technologiestiftung/fix/quotes
raphael-arce May 11, 2023
033c3e2
Merge branch 'feat/auth-via-supabase' of github.com:technologiestiftu…
ff6347 May 11, 2023
bcf3ec9
test: remove webcrypto modul
ff6347 May 11, 2023
de30fc4
Merge pull request #582 from technologiestiftung/test/remove-webcrypto
ff6347 May 11, 2023
a07baa4
feat: added idea folder to gitignore
raphael-arce May 11, 2023
2dec7aa
chore: upgraded supabase libs to latest version
raphael-arce May 11, 2023
4534f07
fix: moved password recovery to an own page
raphael-arce May 11, 2023
52efc67
chore: Update database types
ff6347 May 11, 2023
fb9ffe8
Merge pull request #583 from technologiestiftung/fix/password-recover…
ff6347 May 11, 2023
c9faaaf
Merge pull request #584 from technologiestiftung/chore/update-databas…
raphael-arce May 12, 2023
6948cc8
chore: downgraded supabase/auth-helpers-nextjs because of incompatibi…
raphael-arce May 15, 2023
3ca61fc
feat: add notification placeholder to improve visual stability
raphael-arce May 15, 2023
99cecf3
Merge branch 'staging' into feat/auth-via-supabase
ff6347 May 23, 2023
04dfc7c
Merge branch 'feat/auth-via-supabase' into feat/use-fixed-size-modal
ff6347 May 23, 2023
80f3d44
Merge pull request #587 from technologiestiftung/feat/use-fixed-size-…
ff6347 May 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# The absolute base url
NEXT_PUBLIC_BASE_URL=http://localhost:3000

# Supabase will redirect to this url after recovery
NEXT_PUBLIC_RECOVERY_AUTH_REDIRECT_URL=${NEXT_PUBLIC_BASE_URL}/reset-password

# Mapbox Credentials
NEXT_PUBLIC_MAPBOX_API_KEY=pk.123.xyz

Expand All @@ -22,23 +25,17 @@ NEXT_PUBLIC_MAP_INITIAL_LONGITUDE=13.419047
NEXT_PUBLIC_MAP_INITIAL_ZOOM=11
NEXT_PUBLIC_MAP_INITIAL_ZOOM_MOBILE=13

# Auth0
NEXT_PUBLIC_AUTH0_DOMAIN=myauthzeropath.eu.auth0.com
NEXT_PUBLIC_AUTH0_CLIENT_ID=7479d17d-2212-4a23-a42c-363b898dc618
NEXT_PUBLIC_AUTH0_AUDIENCE=https://my-tree-api-url.io
# giessdenkiez API
# See https://github.com/technologiestiftung/giessdenkiez-de-postgres-api
NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
NEXT_PUBLIC_API_ENDPOINT=http://localhost:8080

# Matomo tracking
NEXT_PUBLIC_MATOMO_SITE_ID=23
NEXT_PUBLIC_MATOMO_URL=https://piwik.example.com
# User management
# Uses the auth0 management API to create the possibility
# to delete users
# see https://github.com/technologiestiftung/tsb-trees-api-user-management
NEXT_PUBLIC_USER_DATA_API_URL=https://my-user-management-api.io

# giessdenkiez API
# See https://github.com/technologiestiftung/giessdenkiez-de-postgres-api
NEXT_PUBLIC_API_ENDPOINT=https://localhost:8000/my-local-postgres-api

# The mail used to send emails to users (recovery, confirm, signup, etc)
NEXT_PUBLIC_FROM_EMAIL=noreply@mail.app.supabase.io
# Disable NextJs telemetry
NEXT_TELEMETRY_DISABLED=1
22 changes: 14 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,26 @@
name: Node.js CI
env:
BUILD_TARGET: DEFAULT
NEXT_PUBLIC_SUPABASE_URL: http://localhost:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0'
NEXT_PUBLIC_API_ENDPOINT: https://localhost:8000/my-local-postgres-api
NEXT_PUBLIC_USER_DATA_API_URL: https://my-user-management-api.io
NEXT_PUBLIC_AUTH0_AUDIENCE: https://my-tree-api-url.io
NEXT_PUBLIC_AUTH0_CLIENT_ID: 7479d17d-2212-4a23-a42c-363b898dc618
NEXT_PUBLIC_AUTH0_DOMAIN: myauthzeropath.eu.auth0.com
NEXT_PUBLIC_BASE_URL: http://localhost:3000
NEXT_PUBLIC_RECOVERY_AUTH_REDIRECT_URL: http://localhost:3000/auth
NEXT_TELEMETRY_DISABLED: '1'
#mapbox related
NEXT_PUBLIC_MAPBOX_TREES_TILESET_LAYER: layer-name-within-tileset
NEXT_PUBLIC_MAPBOX_TREES_TILESET_URL: mapbox://{username}.{tilesetId}
NEXT_PUBLIC_MAP_BOUNDING_BOX: 13.0824446341071,52.3281202651866,13.7682544186827,52.681600197973
NEXT_PUBLIC_MAPBOX_API_KEY: pk.123.xyz
# if you are not in Berlin change these below
NEXT_PUBLIC_MAP_BOUNDING_BOX: 13.0824446341071,52.3281202651866,13.7682544186827,52.681600197973
NEXT_PUBLIC_MAP_INITIAL_LATITUDE: 52.500869
NEXT_PUBLIC_MAP_INITIAL_LONGITUDE: 13.419047
NEXT_PUBLIC_MAP_INITIAL_ZOOM: 11
NEXT_PUBLIC_MAP_INITIAL_ZOOM_MOBILE: 13
# data generated by the harvester
NEXT_PUBLIC_RAIN_DATA_URL: https://tsb-trees.s3.eu-central-1.amazonaws.com/weather_light.geojson.gz
NEXT_PUBLIC_BASE_URL: http://localhost:3000
NEXT_TELEMETRY_DISABLED: '1'
NODE_ENV: test
NEXT_PUBLIC_FROM_EMAIL: noreply@giessdenkiez.de

on:
push:
Expand All @@ -41,7 +48,6 @@ jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"

steps:
- uses: actions/checkout@v3
- name: Use Node.js from .nvmrc
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,6 @@ docs/users-stats/token

# Local Netlify folder
.netlify

# intellij
.idea
8 changes: 0 additions & 8 deletions docs/users-stats/.editorconfig

This file was deleted.

8 changes: 0 additions & 8 deletions docs/users-stats/.env.example

This file was deleted.

2 changes: 0 additions & 2 deletions docs/users-stats/.eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions docs/users-stats/.gitignore

This file was deleted.

26 changes: 0 additions & 26 deletions docs/users-stats/.vscode/settings.json

This file was deleted.

37 changes: 0 additions & 37 deletions docs/users-stats/README.md

This file was deleted.

61 changes: 0 additions & 61 deletions docs/users-stats/explorer.ts

This file was deleted.

44 changes: 0 additions & 44 deletions docs/users-stats/get_token.ts

This file was deleted.

Loading