From 88cd42f996dae978f5ebd6c866ac53475a62f92d Mon Sep 17 00:00:00 2001 From: Siddhant Patil Date: Tue, 10 Oct 2023 04:44:55 +0530 Subject: [PATCH] Google signin testing --- Assets/Scenes/Admin.unity | 178 +++++++++--------- Assets/Scenes/Events.unity | 164 ++++++++-------- Assets/Scenes/Home.unity | 2 +- Assets/Scenes/Location.unity | 164 ++++++++-------- Assets/Scenes/Login-2.unity | 85 +-------- Assets/Scenes/Profile.unity | 18 +- Assets/Scripts/FetchUserDetailsProfile.cs | 20 ++ ...s.meta => FetchUserDetailsProfile.cs.meta} | 2 +- Assets/Scripts/GoogleSigninScript.cs | 30 --- Assets/Scripts/Webviewscript.cs | 48 ++++- ProjectSettings/ProjectSettings.asset | 8 +- server/src/api/controllers/googleAuth.js | 2 +- 12 files changed, 331 insertions(+), 390 deletions(-) create mode 100644 Assets/Scripts/FetchUserDetailsProfile.cs rename Assets/Scripts/{GoogleSigninScript.cs.meta => FetchUserDetailsProfile.cs.meta} (83%) delete mode 100644 Assets/Scripts/GoogleSigninScript.cs diff --git a/Assets/Scenes/Admin.unity b/Assets/Scenes/Admin.unity index fc128d180..388569549 100644 --- a/Assets/Scenes/Admin.unity +++ b/Assets/Scenes/Admin.unity @@ -155,7 +155,7 @@ RectTransform: m_Children: - {fileID: 924691415} - {fileID: 244478709} - - {fileID: 1911746164} + - {fileID: 1645575078} m_Father: {fileID: 828965636} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -237,8 +237,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 53, y: -390} - m_SizeDelta: {x: 340.4241, y: 50.247894} + m_AnchoredPosition: {x: -0.000024796, y: -482} + m_SizeDelta: {x: 184.9198, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &244478710 MonoBehaviour: @@ -294,8 +294,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 1 - m_HorizontalAlignment: 1 - m_VerticalAlignment: 256 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 @@ -1292,7 +1292,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 174, y: 164} + m_AnchoredPosition: {x: 235, y: 164} m_SizeDelta: {x: 332.1587, y: 315.1587} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &866081893 @@ -1412,7 +1412,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 23, y: -208} + m_AnchoredPosition: {x: 0, y: -308} m_SizeDelta: {x: 257.7563, y: 257.7563} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &924691416 @@ -1487,7 +1487,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -217, y: 164} + m_AnchoredPosition: {x: -235, y: 164} m_SizeDelta: {x: 332.1587, y: 315.1587} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &968597815 @@ -2237,7 +2237,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 174, y: -189} + m_AnchoredPosition: {x: 235, y: -201} m_SizeDelta: {x: 332.1587, y: 315.1587} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1563955873 @@ -2322,6 +2322,79 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1563955871} m_CullTransparentMesh: 1 +--- !u!1 &1645575077 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1645575078} + - component: {fileID: 1645575080} + - component: {fileID: 1645575079} + m_Layer: 5 + m_Name: Back + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1645575078 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1645575077} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 217043291} + m_RootOrder: -1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 146, y: -119} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1645575079 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1645575077} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 2800000, guid: c20c29368d1c2fc47a1f9c6eccc8e955, type: 3} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!222 &1645575080 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1645575077} + m_CullTransparentMesh: 1 --- !u!1 &1648446251 GameObject: m_ObjectHideFlags: 0 @@ -2358,9 +2431,9 @@ RectTransform: m_Father: {fileID: 828965636} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 1} - m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0, y: -1611} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: 0, y: 231.99} m_SizeDelta: {x: 1080, y: 463.99} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1648446253 @@ -2545,9 +2618,9 @@ RectTransform: m_Father: {fileID: 828965636} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0.5} - m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 540, y: 5.1311035} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -36} m_SizeDelta: {x: 1080, y: 847.1767} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1794739718 @@ -2625,7 +2698,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -217, y: -193} + m_AnchoredPosition: {x: -235, y: -201} m_SizeDelta: {x: 332.1587, y: 315.1587} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1821905246 @@ -2845,79 +2918,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1868690276} m_CullTransparentMesh: 1 ---- !u!1 &1911746163 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1911746164} - - component: {fileID: 1911746166} - - component: {fileID: 1911746165} - m_Layer: 5 - m_Name: Back - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1911746164 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1911746163} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 217043291} - m_RootOrder: -1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 146, y: -119} - m_SizeDelta: {x: 100, y: 100} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1911746165 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1911746163} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Texture: {fileID: 2800000, guid: c20c29368d1c2fc47a1f9c6eccc8e955, type: 3} - m_UVRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 ---- !u!222 &1911746166 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1911746163} - m_CullTransparentMesh: 1 --- !u!1 &2116543300 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Events.unity b/Assets/Scenes/Events.unity index e4cca0575..d3a83763e 100644 --- a/Assets/Scenes/Events.unity +++ b/Assets/Scenes/Events.unity @@ -866,9 +866,9 @@ RectTransform: m_Father: {fileID: 990750216} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 1} - m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0, y: -843.4487} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 1080, y: 636.2473} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &305862406 @@ -1909,79 +1909,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 648921509} m_CullTransparentMesh: 1 ---- !u!1 &649612571 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 649612572} - - component: {fileID: 649612574} - - component: {fileID: 649612573} - m_Layer: 5 - m_Name: back - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &649612572 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 649612571} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 990750216} - m_RootOrder: -1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 145, y: -113} - m_SizeDelta: {x: 100, y: 100} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &649612573 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 649612571} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Texture: {fileID: 2800000, guid: c20c29368d1c2fc47a1f9c6eccc8e955, type: 3} - m_UVRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 ---- !u!222 &649612574 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 649612571} - m_CullTransparentMesh: 1 --- !u!1 &682463997 GameObject: m_ObjectHideFlags: 0 @@ -2586,7 +2513,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 649612572} + - {fileID: 1084521076} - {fileID: 2142192471} - {fileID: 1675395147} - {fileID: 305862405} @@ -2804,6 +2731,79 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &1084521075 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1084521076} + - component: {fileID: 1084521078} + - component: {fileID: 1084521077} + m_Layer: 5 + m_Name: Back + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1084521076 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1084521075} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 990750216} + m_RootOrder: -1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 146, y: -119.00488} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1084521077 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1084521075} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 2800000, guid: c20c29368d1c2fc47a1f9c6eccc8e955, type: 3} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!222 &1084521078 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1084521075} + m_CullTransparentMesh: 1 --- !u!1 &1152771758 GameObject: m_ObjectHideFlags: 0 @@ -4631,9 +4631,9 @@ RectTransform: m_Father: {fileID: 990750216} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 1} - m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0, y: -1490} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -557} m_SizeDelta: {x: 1080, y: 636.2473} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1667974273 @@ -4710,7 +4710,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0, y: -457} + m_AnchoredPosition: {x: 0, y: -534.4} m_SizeDelta: {x: 1080, y: 136.6543} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1675395148 @@ -5191,7 +5191,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: -4, y: -222} + m_AnchoredPosition: {x: 0, y: -308} m_SizeDelta: {x: 316.1499, y: 316.1499} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2142192472 diff --git a/Assets/Scenes/Home.unity b/Assets/Scenes/Home.unity index 01cd69f12..64ab83af8 100644 --- a/Assets/Scenes/Home.unity +++ b/Assets/Scenes/Home.unity @@ -3002,7 +3002,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 6cd3725baed54bc46bba3acb6850df72, type: 3} + m_Sprite: {fileID: 21300000, guid: 582e52f75701a0f47a8ab90f10b18304, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 diff --git a/Assets/Scenes/Location.unity b/Assets/Scenes/Location.unity index 85f9db538..e08dd0a88 100644 --- a/Assets/Scenes/Location.unity +++ b/Assets/Scenes/Location.unity @@ -1060,9 +1060,9 @@ RectTransform: m_Father: {fileID: 990750216} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 1} - m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0, y: -843.4487} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 110.25} m_SizeDelta: {x: 1080, y: 636.2473} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &305862406 @@ -2103,79 +2103,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 648921509} m_CullTransparentMesh: 1 ---- !u!1 &649612571 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 649612572} - - component: {fileID: 649612574} - - component: {fileID: 649612573} - m_Layer: 5 - m_Name: back - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &649612572 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 649612571} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 990750216} - m_RootOrder: -1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 145, y: -113} - m_SizeDelta: {x: 100, y: 100} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &649612573 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 649612571} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Texture: {fileID: 2800000, guid: c20c29368d1c2fc47a1f9c6eccc8e955, type: 3} - m_UVRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 ---- !u!222 &649612574 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 649612571} - m_CullTransparentMesh: 1 --- !u!1 &682463997 GameObject: m_ObjectHideFlags: 0 @@ -2794,7 +2721,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 649612572} + - {fileID: 1098751061} - {fileID: 2142192471} - {fileID: 1675395147} - {fileID: 305862405} @@ -3147,6 +3074,79 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &1098751060 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1098751061} + - component: {fileID: 1098751063} + - component: {fileID: 1098751062} + m_Layer: 5 + m_Name: Back + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1098751061 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1098751060} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 990750216} + m_RootOrder: -1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 146, y: -119.00488} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1098751062 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1098751060} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 2800000, guid: c20c29368d1c2fc47a1f9c6eccc8e955, type: 3} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!222 &1098751063 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1098751060} + m_CullTransparentMesh: 1 --- !u!1 &1152771758 GameObject: m_ObjectHideFlags: 0 @@ -5251,9 +5251,9 @@ RectTransform: m_Father: {fileID: 990750216} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 1} - m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0, y: -1490} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -492} m_SizeDelta: {x: 1080, y: 636.2473} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1667974273 @@ -5330,7 +5330,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0, y: -457} + m_AnchoredPosition: {x: 0, y: -534.4} m_SizeDelta: {x: 1080, y: 136.6543} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1675395148 @@ -5957,7 +5957,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: -4, y: -222} + m_AnchoredPosition: {x: 0, y: -308} m_SizeDelta: {x: 316.1499, y: 316.1499} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2142192472 diff --git a/Assets/Scenes/Login-2.unity b/Assets/Scenes/Login-2.unity index 8a6d28064..1f64fd701 100644 --- a/Assets/Scenes/Login-2.unity +++ b/Assets/Scenes/Login-2.unity @@ -3809,7 +3809,7 @@ PrefabInstance: - target: {fileID: 4151894008911053694, guid: 7ce667891f662c54ab1b213ad50ef5ce, type: 3} propertyPath: m_RootOrder - value: 6 + value: 5 objectReference: {fileID: 0} - target: {fileID: 4151894008911053694, guid: 7ce667891f662c54ab1b213ad50ef5ce, type: 3} @@ -3871,86 +3871,3 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 7ce667891f662c54ab1b213ad50ef5ce, type: 3} ---- !u!1001 &8238844375581871061 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 3333247943608923372, guid: d40a2845b4a55804cbcd46d00d3e5b4d, - type: 3} - propertyPath: m_RootOrder - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 3333247943608923372, guid: d40a2845b4a55804cbcd46d00d3e5b4d, - type: 3} - propertyPath: m_LocalPosition.x - value: 540 - objectReference: {fileID: 0} - - target: {fileID: 3333247943608923372, guid: d40a2845b4a55804cbcd46d00d3e5b4d, - type: 3} - propertyPath: m_LocalPosition.y - value: 960 - objectReference: {fileID: 0} - - target: {fileID: 3333247943608923372, guid: d40a2845b4a55804cbcd46d00d3e5b4d, - type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3333247943608923372, guid: d40a2845b4a55804cbcd46d00d3e5b4d, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3333247943608923372, guid: d40a2845b4a55804cbcd46d00d3e5b4d, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3333247943608923372, guid: d40a2845b4a55804cbcd46d00d3e5b4d, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3333247943608923372, guid: d40a2845b4a55804cbcd46d00d3e5b4d, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3333247943608923372, guid: d40a2845b4a55804cbcd46d00d3e5b4d, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3333247943608923372, guid: d40a2845b4a55804cbcd46d00d3e5b4d, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3333247943608923372, guid: d40a2845b4a55804cbcd46d00d3e5b4d, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6531682244908402523, guid: d40a2845b4a55804cbcd46d00d3e5b4d, - type: 3} - propertyPath: m_Name - value: GoogleSignin - objectReference: {fileID: 0} - - target: {fileID: 8043367880646982238, guid: d40a2845b4a55804cbcd46d00d3e5b4d, - type: 3} - propertyPath: loader - value: - objectReference: {fileID: 2095058906} - - target: {fileID: 8043367880646982238, guid: d40a2845b4a55804cbcd46d00d3e5b4d, - type: 3} - propertyPath: apiEndpoint - value: /auth/google - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: d40a2845b4a55804cbcd46d00d3e5b4d, type: 3} diff --git a/Assets/Scenes/Profile.unity b/Assets/Scenes/Profile.unity index bb426b087..aaf527632 100644 --- a/Assets/Scenes/Profile.unity +++ b/Assets/Scenes/Profile.unity @@ -123,6 +123,18 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!114 &14102533 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 5024014514723834666, guid: 56587bd4d8d18c44381ecf210239b95d, + type: 3} + m_PrefabInstance: {fileID: 2142934725} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bcef25a8b85686340a4a5dfbe16c39bf, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &27314077 GameObject: m_ObjectHideFlags: 0 @@ -2240,7 +2252,7 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 0} + - m_Target: {fileID: 14102533} m_TargetAssemblyTypeName: SceneLoader, Assembly-CSharp m_MethodName: SceneName m_Mode: 5 @@ -3563,7 +3575,7 @@ MonoBehaviour: m_GameObject: {fileID: 1776942172} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1330541c80bf8d04fbf2a39ad8dbc17f, type: 3} + m_Script: {fileID: 11500000, guid: 05520d9454208694084f1292e83d975c, type: 3} m_Name: m_EditorClassIdentifier: username: {fileID: 244478710} @@ -4122,7 +4134,7 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 0} + - m_Target: {fileID: 14102533} m_TargetAssemblyTypeName: SceneLoader, Assembly-CSharp m_MethodName: SceneName m_Mode: 5 diff --git a/Assets/Scripts/FetchUserDetailsProfile.cs b/Assets/Scripts/FetchUserDetailsProfile.cs new file mode 100644 index 000000000..eda664044 --- /dev/null +++ b/Assets/Scripts/FetchUserDetailsProfile.cs @@ -0,0 +1,20 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.SceneManagement; +using UnityEngine.UI; +using UnityEngine.Networking; +using TMPro; + +public class FetchUserDetailsProfile : MonoBehaviour +{ + public TextMeshProUGUI username; + public TextMeshProUGUI branchYear; + + void Start() + { + UserData user = JsonUtility.FromJson(PlayerPrefs.GetString("UserData")); + username.text = user.name; + branchYear.text = user.branch + ", " + user.year; + } +} diff --git a/Assets/Scripts/GoogleSigninScript.cs.meta b/Assets/Scripts/FetchUserDetailsProfile.cs.meta similarity index 83% rename from Assets/Scripts/GoogleSigninScript.cs.meta rename to Assets/Scripts/FetchUserDetailsProfile.cs.meta index ed4dbdc8e..24edd3bc1 100644 --- a/Assets/Scripts/GoogleSigninScript.cs.meta +++ b/Assets/Scripts/FetchUserDetailsProfile.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4f28eb623be9f914da15ace1f1065188 +guid: 05520d9454208694084f1292e83d975c MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/GoogleSigninScript.cs b/Assets/Scripts/GoogleSigninScript.cs deleted file mode 100644 index f23b115ab..000000000 --- a/Assets/Scripts/GoogleSigninScript.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using TMPro; -using UnityEngine.Networking; -using UnityEngine.UI; -using System.Text.RegularExpressions; -using UnityEngine.SceneManagement; - - -public class GoogleSigninScript : MonoBehaviour -{ - // private string baseURL = "https://arrowserver.vercel.app"; - private string baseURL = "http://localhost:5000"; // To run server locally. - [SerializeField] private string apiEndpoint; - public GameObject loader; - public TextMeshProUGUI serverMsg; - public void onGoogleButtonClick() - { - // serverMsg.text = ""; - loader.SetActive(true); - StartCoroutine(TryGoogleLogin()); - } - private IEnumerator TryGoogleLogin() - { - loader.SetActive(false); - Application.OpenURL("http://localhost:5000/auth/google"); - yield return null; - } -} diff --git a/Assets/Scripts/Webviewscript.cs b/Assets/Scripts/Webviewscript.cs index 3928bdd6a..15108e228 100644 --- a/Assets/Scripts/Webviewscript.cs +++ b/Assets/Scripts/Webviewscript.cs @@ -12,19 +12,13 @@ public class Webviewscript : MonoBehaviour { public void ShowUrlPopupPositionSize() { - GpmWebViewSafeBrowsing.ShowSafeBrowsing("https://arrowserver.vercel.app/", + GpmWebViewSafeBrowsing.ShowSafeBrowsing("https://arrowserver.vercel.app/auth/google", new GpmWebViewRequest.ConfigurationSafeBrowsing() { navigationBarColor = "#000000", navigationTextColor = "#FFFFFF" }, OnCallback); - - // GpmWebViewCallback.CallbackType.PageLoad; - // if (string.IsNullOrEmpty(data) == false) - // { - // Debug.LogFormat("Loaded Page:{0}", data); - // } } private void OnCallback( @@ -57,9 +51,11 @@ private void OnCallback( if (string.IsNullOrEmpty(data) == false) { Debug.LogFormat("Loaded Page:{0}", data); - string username = PlayerPrefs.GetString("name"); - username = data; - PlayerPrefs.SetString("name", username); + + if (data == "https://arrowserver.vercel.app/auth/protected") + { + StartCoroutine(FetchJsonData(data)); + } } break; case GpmWebViewCallback.CallbackType.MultiWindowOpen: @@ -97,4 +93,36 @@ private void OnCallback( #endif } } + + IEnumerator FetchJsonData(string url) + { + UnityWebRequest request = UnityWebRequest.Get(url); + yield return request.SendWebRequest(); + + if (request.isNetworkError || request.isHttpError) + { + Debug.Log("Error while fetching data"); + } + else + { + SigninResponse response = JsonUtility.FromJson(request.downloadHandler.text); + + PlayerPrefs.SetString("Token", response.token); + + Debug.Log(response.result); + PlayerPrefs.SetString("UserData", JsonUtility.ToJson(response.result)); + + UserData user = JsonUtility.FromJson(PlayerPrefs.GetString("UserData")); + + Debug.Log(user.isOnboarded); + if (user.isOnboarded == true) + { + SceneManager.LoadScene("Home"); + } + else + { + SceneManager.LoadScene("[Ob]Start"); + } + } + } } \ No newline at end of file diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index bd429efe4..a0dd9a12f 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -137,13 +137,7 @@ PlayerSettings: vulkanEnableCommandBufferRecycling: 1 loadStoreDebugModeEnabled: 0 bundleVersion: 1.0 - preloadedAssets: - - {fileID: 11400000, guid: 1eb95d77acb39444e8cf44313496a874, type: 2} - - {fileID: 7902032969412398322, guid: 58f40b12bbc864f3c96c6505a9a1e1e3, type: 2} - - {fileID: 11400000, guid: 7c8dd98ea9509454b9df2c29918ede40, type: 2} - - {fileID: 891873303134440036, guid: 6bb381a8ba31f114d9724357633b4625, type: 2} - - {fileID: 4800000, guid: c9f956787b1d945e7b36e0516201fc76, type: 3} - - {fileID: 4800000, guid: 0945859e5a1034c2cb6dce53cb4fb899, type: 3} + preloadedAssets: [] metroInputSource: 0 wsaTransparentSwapchain: 0 m_HolographicPauseOnTrackingLoss: 1 diff --git a/server/src/api/controllers/googleAuth.js b/server/src/api/controllers/googleAuth.js index 324b08d64..b7609468e 100644 --- a/server/src/api/controllers/googleAuth.js +++ b/server/src/api/controllers/googleAuth.js @@ -38,7 +38,7 @@ export const authenticated = (req, res)=>{ res.status(200).json({ success: true, - user: req.user, + result: req.user, token: token }) }